Tokens for Steps

pull/5756/head
Cagatay Civici 2024-05-11 11:55:03 +03:00
parent c5157b8921
commit 1505ce359e
3 changed files with 56 additions and 22 deletions

View File

@ -54,14 +54,16 @@ const theme = ({ dt }) => `
align-items: center; align-items: center;
overflow: hidden; overflow: hidden;
text-decoration: none; text-decoration: none;
transition: outline-color ${dt('transition.duration')}; transition: outline-color ${dt('transition.duration')}, box-shadow ${dt('transition.duration')};
border-radius: ${dt('border.radius.md')}; border-radius: ${dt('steps.item.link.border.radius')};
outline-color: transparent; outline-color: transparent;
gap: ${dt('steps.item.link.gap')};
} }
.p-steps-item-link:not(.p-disabled):focus-visible { .p-steps-item-link:not(.p-disabled):focus-visible {
outline: ${dt('focus.ring.width')} ${dt('focus.ring.style')} ${dt('focus.ring.color')}; box-shadow: ${dt('steps.item.link.focus.ring.shadow')};
outline-offset: ${dt('focus.ring.offset')}; outline: ${dt('steps.item.link.focus.ring.width')} ${dt('steps.item.link.focus.ring.style')} ${dt('steps.item.link.focus.ring.color')};
outline-offset: ${dt('steps.item.link.focus.ring.offset')};
} }
.p-steps-item-label { .p-steps-item-label {
@ -69,10 +71,9 @@ const theme = ({ dt }) => `
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
max-width: 100%; max-width: 100%;
margin-top: 0.5rem;
color: ${dt('steps.item.label.color')}; color: ${dt('steps.item.label.color')};
display: block; display: block;
font-weight: 500; font-weight: ${dt('steps.item.label.font.weight')};
} }
.p-steps-item-number { .p-steps-item-number {
@ -82,14 +83,14 @@ const theme = ({ dt }) => `
color: ${dt('steps.item.number.color')}; color: ${dt('steps.item.number.color')};
border: 2px solid ${dt('steps.item.number.border.color')}; border: 2px solid ${dt('steps.item.number.border.color')};
background: ${dt('steps.item.number.background')}; background: ${dt('steps.item.number.background')};
min-width: 2rem; min-width: ${dt('steps.item.number.size')};
height: 2rem; height: ${dt('steps.item.number.size')};
line-height: 2rem; line-height: ${dt('steps.item.number.size')};
font-size: 1.143rem; font-size: ${dt('steps.item.number.font.size')};
z-index: 1; z-index: 1;
border-radius: 50%; border-radius: ${dt('steps.item.number.border.radius')};
position: relative; position: relative;
font-weight: 500; font-weight: ${dt('steps.item.number.font.weight')};
} }
.p-steps-item-number::after { .p-steps-item-number::after {
@ -97,8 +98,8 @@ const theme = ({ dt }) => `
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 50%; border-radius: ${dt('steps.item.number.border.radius')};
box-shadow: 0px 0.5px 0px 0px rgba(0, 0, 0, 0.06), 0px 1px 1px 0px rgba(0, 0, 0, 0.12); box-shadow: ${dt('steps.item.number.shadow')};
} }
.p-steps:not(.p-readonly) .p-steps-item { .p-steps:not(.p-readonly) .p-steps-item {
@ -111,7 +112,6 @@ const theme = ({ dt }) => `
} }
.p-steps-item-active .p-steps-item-label { .p-steps-item-active .p-steps-item-label {
font-weight: 500;
color: ${dt('steps.item.label.active.color')}; color: ${dt('steps.item.label.active.color')};
} }
`; `;

View File

@ -2,15 +2,32 @@ export default {
separator: { separator: {
background: '{content.border.color}' background: '{content.border.color}'
}, },
itemLink: {
borderRadius: '{content.border.radius}',
focusRing: {
width: '{focus.ring.width}',
style: '{focus.ring.style}',
color: '{focus.ring.color}',
offset: '{focus.ring.offset}',
shadow: '{focus.ring.shadow}'
},
gap: '0.5rem'
},
itemLabel: { itemLabel: {
color: '{text.color}', color: '{text.muted.color}',
activeColor: '{primary.color}' activeColor: '{primary.color}',
fontWeight: '500'
}, },
itemNumber: { itemNumber: {
background: '{content.background}', background: '{content.background}',
activeBackground: '{content.background}', activeBackground: '{content.background}',
borderColor: '{content.border.color}', borderColor: '{content.border.color}',
color: '{text.muted.color}', color: '{text.muted.color}',
activeColor: '{primary.color}' activeColor: '{primary.color}',
size: '2rem',
fontSize: '1.143rem',
fontWeight: '500',
borderRadius: '50%',
shadow: '0px 0.5px 0px 0px rgba(0, 0, 0, 0.06), 0px 1px 1px 0px rgba(0, 0, 0, 0.12)'
} }
}; };

View File

@ -2,15 +2,32 @@ export default {
separator: { separator: {
background: '{content.border.color}' background: '{content.border.color}'
}, },
itemLink: {
borderRadius: '{content.border.radius}',
focusRing: {
width: '{focus.ring.width}',
style: '{focus.ring.style}',
color: '{focus.ring.color}',
offset: '{focus.ring.offset}',
shadow: '{focus.ring.shadow}'
},
gap: '0.5rem'
},
itemLabel: { itemLabel: {
color: '{text.color}', color: '{text.muted.color}',
activeColor: '{primary.color}' activeColor: '{primary.color}',
fontWeight: '500'
}, },
itemNumber: { itemNumber: {
background: '{content.background}', background: '{content.background}',
activeBackground: '{content.background}', activeBackground: '{primary.color}',
borderColor: '{content.border.color}', borderColor: '{content.border.color}',
color: '{text.muted.color}', color: '{text.muted.color}',
activeColor: '{primary.color}' activeColor: '{primary.inverse.color}',
size: '2.25rem',
fontSize: '1.125rem',
fontWeight: '500',
borderRadius: '50%',
shadow: 'none'
} }
}; };