-
Notifications
You must be signed in to change notification settings - Fork 50
[Project Solar / Phase 1 / Components] Tag carbonization
#3685
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: project-solar/phase-1-main-feature-branch
Are you sure you want to change the base?
Changes from all commits
a2b22c8
bd826f8
dd82ba9
87ba79b
e9d1ecf
d7c6f15
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,26 +8,30 @@ | |
| // | ||
|
|
||
| @use "../mixins/focus-ring" as *; | ||
|
|
||
| // we set a higher value than the line-height (~13px) to accommodate cases where the text wraps | ||
| $hds-tag-border-radius: 50px; | ||
| @use "../mixins/carbonization" as *; | ||
|
|
||
| .hds-tag { | ||
| display: inline-flex; | ||
| align-items: stretch; | ||
| width: fit-content; | ||
| max-width: 100%; | ||
| vertical-align: middle; | ||
| background-color: var(--token-color-surface-interactive); | ||
| background-color: var(--token-tag-surface-color-default); | ||
| border: 1px solid var(--token-color-border-strong); | ||
| border-radius: $hds-tag-border-radius; | ||
| border-radius: var(--token-tag-border-radius); | ||
|
|
||
| @include hds-apply-only-if-carbon() { | ||
| &:not(.hds-tag--color-primary, .hds-tag--color-secondary) { | ||
| border: none; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| .hds-tag__dismiss { | ||
| flex: 0 0 auto; | ||
| margin: 0; // reset default button margin | ||
| padding: 6px 4px 6px 8px; | ||
| background-color: var(--token-color-surface-interactive); | ||
| background-color: var(--token-tag-surface-color-default); | ||
| border: none; // reset default button border | ||
| border-radius: inherit; | ||
| border-top-right-radius: 0; | ||
|
|
@@ -37,26 +41,37 @@ $hds-tag-border-radius: 50px; | |
| .hds-tag__dismiss-icon { | ||
| width: 12px; | ||
| height: 12px; | ||
| color: var(--token-tag-icon-color); | ||
| } | ||
|
|
||
| .hds-tag__dismiss-icon, | ||
| .hds-tag__dismiss, | ||
| .hds-tag__text { | ||
| color: var(--token-color-foreground-primary); | ||
| color: var(--token-tag-foreground-color-default); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like this style was there before (now gone in this PR) that was controlling the svg icon color:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This has been fixed now. I added in some icon color tokens like there are in Figma. I had to separate the link primary and secondary colors for the icon from the plain text color. So I have three new variables
|
||
| } | ||
|
|
||
| .hds-tag__text, | ||
| .hds-tag__link { | ||
| flex: 1 0 0; | ||
| max-width: 166px; // account for excess horizontal padding of text in non-dismissible variant | ||
| padding: 3px 10px 5px 10px; | ||
| background-color: var(--token-color-surface-interactive); | ||
| max-width: var(--token-tag-max-width); // account for excess horizontal padding of text in non-dismissible variant | ||
| padding: var(--token-tag-padding-top) var(--token-tag-padding-right) var(--token-tag-padding-bottom) | ||
| var(--token-tag-padding-left); | ||
| background-color: var(--token-tag-surface-color-default); | ||
| border-radius: inherit; | ||
| } | ||
|
|
||
| .hds-tag__link { | ||
| @include hds-apply-only-if-carbon() { | ||
| text-decoration: none; | ||
| } | ||
| } | ||
|
|
||
| .hds-tag__text-container { | ||
| display: -webkit-box; | ||
| overflow: hidden; | ||
| line-height: 1rem; // 16px - override `body-100` | ||
| font-weight: var(--token-typography-font-weight-regular); | ||
| font-size: var(--token-tag-typography-font-size); | ||
| line-height: var(--token-tag-typography-line-height); | ||
| letter-spacing: var(--token-tag-typography-letter-spacing); | ||
| word-break: break-all; | ||
| -webkit-box-orient: vertical; | ||
| -webkit-line-clamp: 1; | ||
|
|
@@ -65,8 +80,8 @@ $hds-tag-border-radius: 50px; | |
|
|
||
| .hds-tag__dismiss ~ .hds-tag__text, | ||
| .hds-tag__dismiss ~ .hds-tag__link { | ||
| max-width: 160px; | ||
| padding: 3px 8px 5px 6px; | ||
| max-width: calc(var(--token-tag-max-width) - 6px); | ||
| padding: var(--token-tag-padding-top) 8px var(--token-tag-padding-bottom) 6px; | ||
| border-top-left-radius: 0; | ||
| border-bottom-left-radius: 0; | ||
| } | ||
|
|
@@ -79,12 +94,12 @@ $hds-tag-border-radius: 50px; | |
|
|
||
| &:hover, | ||
| &.mock-hover { | ||
| background-color: var(--token-color-surface-interactive-hover); | ||
| background-color: var(--token-tag-surface-color-hover); | ||
| } | ||
|
|
||
| &:active, | ||
| &.mock-active { | ||
| background-color: var(--token-color-surface-interactive-active); | ||
| background-color: var(--token-tag-surface-color-active); | ||
| } | ||
|
|
||
| &:focus, | ||
|
|
@@ -112,23 +127,50 @@ $hds-tag-border-radius: 50px; | |
| // COLORS (FOR LINK) | ||
|
|
||
| .hds-tag--color-primary { | ||
| border: 1px solid var(--token-tag-link-border-color-primary); | ||
|
|
||
| .hds-tag__link, | ||
| &:has(.hds-tag__link) .hds-tag__dismiss { | ||
| background-color: var(--token-tag-link-surface-color-primary-default); | ||
|
|
||
| &:hover, | ||
| &.mock-hover { | ||
| background-color: var(--token-tag-link-surface-color-primary-hover); | ||
| } | ||
|
|
||
| &:active, | ||
| &.mock-active { | ||
| background-color: var(--token-tag-link-surface-color-primary-hover); | ||
| } | ||
| } | ||
|
|
||
| .hds-tag__link { | ||
| color: var(--token-color-foreground-action); | ||
| color: var(--token-tag-link-foreground-color-primary-default); | ||
|
|
||
| &:hover, | ||
| &.mock-hover { | ||
| color: var(--token-color-foreground-action-hover); | ||
| color: var(--token-tag-link-foreground-color-primary-hover); | ||
| } | ||
|
|
||
| &:active, | ||
| &.mock-active { | ||
| color: var(--token-color-foreground-action-active); | ||
| color: var(--token-tag-link-foreground-color-primary-active); | ||
| } | ||
| } | ||
|
|
||
| .hds-tag__dismiss-icon { | ||
| color: var(--token-tag-link-icon-color-primary); | ||
| } | ||
| } | ||
|
|
||
| .hds-tag--color-secondary { | ||
| border: 1px solid var(--token-tag-link-border-color-secondary); | ||
|
|
||
| .hds-tag__link { | ||
| color: var(--token-color-foreground-strong); | ||
| color: var(--token-tag-link-foreground-color-secondary-default); | ||
| } | ||
|
|
||
| .hds-tag__dismiss-icon { | ||
| color: var(--token-tag-link-icon-color-secondary); | ||
| } | ||
| } | ||


Uh oh!
There was an error while loading. Please reload this page.