Updated ConfirmPopup tokens

pull/5756/head
Cagatay Civici 2024-05-09 12:59:05 +03:00
parent 438440072f
commit 6c8136c4aa
3 changed files with 58 additions and 27 deletions

View File

@ -3,37 +3,35 @@ import BaseStyle from 'primevue/base/style';
const theme = ({ dt }) => ` const theme = ({ dt }) => `
.p-confirmpopup { .p-confirmpopup {
position: absolute; position: absolute;
margin-top: 10px; margin-top: ${dt('confirmpopup.gutter')};
top: 0; top: 0;
left: 0; left: 0;
background: ${dt('confirmpopup.background')}; background: ${dt('confirmpopup.background')};
color: ${dt('confirmpopup.color')}; color: ${dt('confirmpopup.color')};
border: 1px solid ${dt('confirmpopup.border.color')}; border: 1px solid ${dt('confirmpopup.border.color')};
border-radius: ${dt('border.radius.md')}; border-radius: ${dt('confirmpopup.border.radius')};
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); box-shadow: ${dt('confirmpopup.shadow')};
} }
.p-confirmpopup-content { .p-confirmpopup-content {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 1rem; padding: ${dt('confirmpopup.content.padding')};
gap: ${dt('confirmpopup.content.gap')};
} }
.p-confirmpopup-icon { .p-confirmpopup-icon {
font-size: 1.5rem; font-size: ${dt('confirmpopup.icon.size')};
width: 1.5rem; width: ${dt('confirmpopup.icon.size')};
height: 1.5rem; height: ${dt('confirmpopup.icon.size')};
} color: ${dt('confirmpopup.icon.color')};
.p-confirmpopup-message {
margin-left: 1rem;
} }
.p-confirmpopup-footer { .p-confirmpopup-footer {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
gap: 0.5rem; gap: ${dt('confirmpopup.footer.gap')};
padding: 0 1rem 1rem 1rem; padding: ${dt('confirmpopup.footer.padding')};
} }
.p-confirmpopup-footer button { .p-confirmpopup-footer button {
@ -46,7 +44,7 @@ const theme = ({ dt }) => `
.p-confirmpopup-flipped { .p-confirmpopup-flipped {
margin-top: 0; margin-top: 0;
margin-bottom: 10px; margin-bottom: ${dt('confirmpopup.gutter')};
} }
.p-confirmpopup-enter-from { .p-confirmpopup-enter-from {
@ -69,7 +67,7 @@ const theme = ({ dt }) => `
.p-confirmpopup:after, .p-confirmpopup:after,
.p-confirmpopup:before { .p-confirmpopup:before {
bottom: 100%; bottom: 100%;
left: ${dt('{overlay.arrow.left} + 1.25rem', 0)}; left: ${dt('confirmpopup.arrow.offset')};
content: " "; content: " ";
height: 0; height: 0;
width: 0; width: 0;
@ -78,16 +76,16 @@ const theme = ({ dt }) => `
} }
.p-confirmpopup:after { .p-confirmpopup:after {
border-width: 8px; border-width: calc(${dt('confirmpopup.gutter')} - 2px);
margin-left: -8px; margin-left: calc(-1 * (${dt('confirmpopup.gutter')} - 2px));
border-style: solid; border-style: solid;
border-color: transparent; border-color: transparent;
border-bottom-color: ${dt('confirmpopup.background')}; border-bottom-color: ${dt('confirmpopup.background')};
} }
.p-confirmpopup:before { .p-confirmpopup:before {
border-width: 10px; border-width: ${dt('confirmpopup.gutter')};
margin-left: -10px; margin-left: calc(-1 * ${dt('confirmpopup.gutter')});
border-style: solid; border-style: solid;
border-color: transparent; border-color: transparent;
border-bottom-color: ${dt('confirmpopup.border.color')}; border-bottom-color: ${dt('confirmpopup.border.color')};

View File

@ -1,7 +1,24 @@
export default { export default {
root: { root: {
background: '{content.background}', background: '{overlay.popover.background}',
borderColor: '{content.border.color}', borderColor: '{overlay.popover.border.color}',
color: '{content.color}' color: '{overlay.popover.color}',
} borderRadius: '{overlay.popover.border.radius}',
padding: '{overlay.popover.padding}',
shadow: '{overlay.popover.shadow}',
gutter: '10px'
},
content: {
padding: '{overlay.popover.padding}',
gap: '1rem'
},
icon: {
size: '1.5rem',
color: '{overlay.popover.color}'
},
footer: {
gap: '0.5rem',
padding: '0 {overlay.popover.padding} {overlay.popover.padding} {overlay.popover.padding}'
},
arrowOffset: '1.25rem'
}; };

View File

@ -1,7 +1,23 @@
export default { export default {
root: { root: {
background: '{content.background}', background: '{overlay.popover.background}',
borderColor: '{content.border.color}', borderColor: '{overlay.popover.border.color}',
color: '{content.color}' color: '{overlay.popover.color}',
} borderRadius: '{overlay.popover.border.radius}',
shadow: '{overlay.popover.shadow}',
gutter: '10px'
},
content: {
padding: '{overlay.popover.padding}',
gap: '1rem'
},
icon: {
size: '1.5rem',
color: '{overlay.popover.color}'
},
footer: {
gap: '0.5rem',
padding: '0 {overlay.popover.padding} {overlay.popover.padding} {overlay.popover.padding}'
},
arrowOffset: '1.25rem'
}; };