-
Notifications
You must be signed in to change notification settings - Fork 58
feat(component): Add Tag component #3062
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
Changes from 44 commits
ea6b825
50f895d
0b1661d
80d23be
c58fc85
5b49096
bf63370
a30f6f1
85c9560
560c185
bf023b9
e3d88da
efa0334
1463717
e05c493
093da75
4269780
1b55e60
469fff6
7fceb97
9f8378b
d628345
6b7373b
78ac370
ee907aa
fd441fa
03f775a
9a897aa
3b698a0
cacee07
725ea75
ea699b9
d6db50e
108ef07
3b50cd9
f31cfe6
910f1fa
584827a
ea712bc
61e37bd
f3bfe21
e0ea131
d422603
3f43694
e4d5793
56ba557
61ae11f
1a1fc6e
bbd0998
213e254
a8eebae
44dedeb
99acca5
8cfb428
b80d099
45f6825
4875fec
300e75f
1d5acd8
250f93f
df8a4d9
efe088c
01cabb9
36d3a47
bda0511
6dac73b
7c425df
7262621
e04cf7d
2b9911f
12400a9
381461a
094b2d0
cc9e1b7
f67f9a9
91313b0
a310b75
f3abaf0
e20b6d6
fe2ec27
86ffbe0
1b1da29
df6076e
c3b1592
25808eb
4a98482
d94380f
a317897
3671fee
1d4a00d
3e7ceed
8502337
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 |
|---|---|---|
| @@ -0,0 +1,189 @@ | ||
| .tag { | ||
| --#{$prefix}tag-min-width: #{$ouds-tag-size-min-width-default}; | ||
| --#{$prefix}tag-min-height: #{$ouds-tag-size-min-height-default}; | ||
| --#{$prefix}tag-color: #{$ouds-color-content-on-status-neutral-emphasized}; | ||
| --#{$prefix}tag-border-width: 0px; | ||
| --#{$prefix}tag-background-color: #{$ouds-color-surface-status-neutral-emphasized}; | ||
| --#{$prefix}tag-padding-start: #{$ouds-tag-space-padding-inline-default}; | ||
| --#{$prefix}tag-padding-end: #{$ouds-tag-space-padding-inline-default}; | ||
| --#{$prefix}tag-padding-asset: #{$ouds-tag-space-padding-inline-asset-default}; | ||
| --#{$prefix}tag-padding-y: #{$ouds-tag-space-padding-block-default}; | ||
| --#{$prefix}tag-asset-container-size: #{$ouds-tag-size-asset-default}; | ||
| --#{$prefix}tag-asset-padding: #{$ouds-tag-space-inset-icon-default}; | ||
| --#{$prefix}tag-asset-gap: #{$ouds-tag-space-column-gap-default}; | ||
| --#{$prefix}tag-asset-color: currentcolor; | ||
| --#{$prefix}tag-loading-dasharray: 92; | ||
| --#{$prefix}tag-loading-animation: 2.1875s infinite linear rotate1-indeterminate, 1.25s linear infinite rotate2-indeterminate; | ||
|
|
||
| position: relative; | ||
| display: inline-flex; | ||
| gap: var(--#{$prefix}tag-asset-gap); | ||
| align-items: center; | ||
| justify-content: center; | ||
| min-width: var(--#{$prefix}tag-min-width); | ||
| min-height: var(--#{$prefix}tag-min-height); | ||
| padding: subtract(var(--#{$prefix}tag-padding-y), var(--#{$prefix}tag-border-width)) subtract(var(--#{$prefix}tag-padding-end), var(--#{$prefix}tag-border-width)) subtract(var(--#{$prefix}tag-padding-y), var(--#{$prefix}tag-border-width)) subtract(var(--#{$prefix}tag-padding-start), var(--#{$prefix}tag-border-width)); | ||
| margin: 0; | ||
| font-weight: 700; | ||
| color: var(--#{$prefix}tag-color); | ||
| white-space: nowrap; | ||
| vertical-align: text-bottom; // TODO alignment to check with text in <p> | ||
| background-color: var(--#{$prefix}tag-background-color); | ||
| @include get-font-size("label-medium"); | ||
| @include border-radius($ouds-tag-border-radius); | ||
|
|
||
| &:has(.tag-asset-container) { | ||
| --#{$prefix}tag-padding-start: var(--#{$prefix}tag-padding-asset); | ||
| } | ||
| } | ||
|
|
||
| .tag-asset-container { | ||
| display: flex; | ||
| flex-shrink: 0; | ||
| align-items: center; | ||
| width: var(--#{$prefix}tag-asset-container-size); | ||
| height: var(--#{$prefix}tag-asset-container-size); | ||
| padding: var(--#{$prefix}tag-asset-padding); | ||
|
|
||
| svg, | ||
| img, | ||
| .icon { | ||
| width: 100%; | ||
| height: 100%; | ||
| overflow: hidden; | ||
| line-height: 1; | ||
| color: var(--#{$prefix}tag-asset-color); | ||
| } | ||
|
|
||
| &:has(.tag-bullet) { | ||
| --#{$prefix}tag-asset-padding: #{$ouds-tag-space-inset-bullet-default}; | ||
| } | ||
|
|
||
| &:has(.tag-loader) { | ||
| --#{$prefix}tag-asset-padding: #{$ouds-tag-space-inset-loader-default}; | ||
| } | ||
| } | ||
|
|
||
| .tag-bullet { | ||
| width: 100%; | ||
| height: 100%; | ||
| background-color: var(--#{$prefix}tag-asset-color); | ||
| @include border-radius(#{$ouds-tag-border-radius}); | ||
|
||
| } | ||
|
|
||
| .tag-loader { // TODO copied from button loader, should be factorized | ||
|
||
| --#{$prefix}tag-asset-color: currentcolor; | ||
|
|
||
| display: block; | ||
| margin: 0; | ||
| font-size: var(--#{$prefix}tag-asset-container-size); | ||
| transform: rotate(-90deg); | ||
|
|
||
| > .tag-loader-inner { | ||
| fill: none; | ||
| stroke: var(--#{$prefix}tag-asset-color); | ||
| stroke-dasharray: var(--#{$prefix}tag-loading-dasharray); | ||
| stroke-width: 8; | ||
| transform-origin: center; | ||
| animation: var(--#{$prefix}tag-loading-animation); | ||
| } | ||
| } | ||
|
|
||
| .tag-disabled { // TODO: [aria-disabled="true"] ? | ||
hannahiss marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| --#{$prefix}tag-color: #{$ouds-color-content-on-action-disabled}; | ||
| --#{$prefix}tag-background-color: #{$ouds-color-action-disabled}; | ||
| } | ||
|
|
||
| .tag.text-bg-status-accent-muted { | ||
| --#{$prefix}tag-asset-color: #{$ouds-color-surface-status-accent-emphasized}; | ||
| } | ||
|
|
||
| .tag.text-bg-status-positive-muted { | ||
| --#{$prefix}tag-asset-color: #{$ouds-color-surface-status-positive-emphasized}; | ||
| } | ||
|
|
||
| .tag.text-bg-status-info-muted { | ||
| --#{$prefix}tag-asset-color: #{$ouds-color-surface-status-info-emphasized}; | ||
| } | ||
|
|
||
| .tag.text-bg-status-warning-muted { | ||
| --#{$prefix}tag-asset-color: #{$ouds-color-surface-status-warning-emphasized}; | ||
| } | ||
|
|
||
| .tag.text-bg-status-negative-muted { | ||
| --#{$prefix}tag-asset-color: #{$ouds-color-surface-status-negative-emphasized}; | ||
| } | ||
|
|
||
| .tag-sm { | ||
| --#{$prefix}tag-padding-start: #{$ouds-tag-space-padding-inline-small}; | ||
| --#{$prefix}tag-padding-end: #{$ouds-tag-space-padding-inline-small}; | ||
| --#{$prefix}tag-padding-start-asset: #{$ouds-tag-space-padding-inline-asset-small}; | ||
| --#{$prefix}tag-padding-y: #{$ouds-tag-space-padding-block-small}; | ||
| --#{$prefix}tag-min-width: #{$ouds-tag-size-min-width-small}; | ||
| --#{$prefix}tag-min-height: #{$ouds-tag-size-min-height-small}; | ||
| --#{$prefix}tag-asset-container-size: #{$ouds-tag-size-asset-small}; | ||
| --#{$prefix}tag-bullet-padding: #{$ouds-tag-space-inset-bullet-small}; | ||
| --#{$prefix}tag-icon-padding: #{$ouds-tag-space-inset-icon-small}; | ||
| --#{$prefix}tag-loader-padding: #{$ouds-tag-space-inset-loader-small}; | ||
| --#{$prefix}tag-asset-gap: #{$ouds-tag-space-column-gap-small}; | ||
| @include get-font-size("label-small"); | ||
| } | ||
|
|
||
| .tag-input { | ||
| --#{$prefix}tag-color: #{$ouds-tag-input-color-content-enabled}; | ||
| --#{$prefix}tag-background-color: #{$ouds-tag-input-color-bg-enabled}; | ||
| --#{$prefix}tag-border-color: #{$ouds-tag-input-color-border-enabled}; | ||
| --#{$prefix}tag-border-width: #{$ouds-tag-input-border-width-default}; | ||
| --#{$prefix}tag-padding-end: var(--#{$prefix}tag-padding-asset); | ||
|
|
||
| margin: calc(($ouds-tag-size-min-height-interactive-area - var(--#{$prefix}tag-min-height)) / 2) 0; // stylelint-disable-line function-disallowed-list | ||
| border: var(--#{$prefix}tag-border-width) solid var(--#{$prefix}tag-border-color); | ||
|
|
||
| &::before { | ||
| position: absolute; | ||
| top: calc(-.5 * ($ouds-tag-size-min-height-interactive-area - var(--bs-tag-min-height)) - var(--#{$prefix}tag-border-width)); // stylelint-disable-line function-disallowed-list | ||
| right: calc(-1 * var(--#{$prefix}tag-border-width)); // stylelint-disable-line function-disallowed-list | ||
| bottom: calc(-.5 * ($ouds-tag-size-min-height-interactive-area - var(--bs-tag-min-height)) - var(--#{$prefix}tag-border-width)); // stylelint-disable-line function-disallowed-list | ||
| left: calc(-1 * var(--#{$prefix}tag-border-width)); // stylelint-disable-line function-disallowed-list | ||
| content: ""; | ||
| } | ||
|
|
||
| &::after { | ||
| width: var(--#{$prefix}tag-asset-container-size); | ||
| height: var(--#{$prefix}tag-asset-container-size); | ||
hannahiss marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| content: ""; | ||
| background-color: currentcolor; | ||
| mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 1000'><path d='M500 83.333 416.667 0 250 166.667 83.333 0 0 83.333 166.667 250 0 416.667 83.333 500 250 333.333 416.667 500 500 416.667 333.333 250z' transform='translate(250 250)'/></svg>"); | ||
| } | ||
|
|
||
| &:hover { | ||
| --#{$prefix}tag-color: #{$ouds-tag-input-color-content-hover}; | ||
| --#{$prefix}tag-background-color: #{$ouds-tag-input-color-bg-hover}; | ||
| --#{$prefix}tag-border-color: #{$ouds-tag-input-color-border-hover}; | ||
| --#{$prefix}tag-border-width: #{$ouds-tag-input-border-width-default-interaction}; | ||
| } | ||
|
|
||
| &:active { | ||
| --#{$prefix}tag-color: #{$ouds-tag-input-color-content-pressed}; | ||
| --#{$prefix}tag-background-color: #{$ouds-tag-input-color-bg-pressed}; | ||
| --#{$prefix}tag-border-color: #{$ouds-tag-input-color-border-pressed}; | ||
| --#{$prefix}tag-border-width: #{$ouds-tag-input-border-width-default-interaction}; | ||
| } | ||
|
|
||
| &:focus-visible { | ||
| --#{$prefix}tag-color: #{$ouds-tag-input-color-content-focus}; | ||
| --#{$prefix}tag-background-color: #{$ouds-tag-input-color-bg-focus}; | ||
| --#{$prefix}tag-border-color: #{$ouds-tag-input-color-border-focus}; | ||
| --#{$prefix}tag-border-width: #{$ouds-tag-input-border-width-default-interaction}; | ||
| } | ||
|
|
||
| &:disabled, | ||
| &[aria-disabled="true"] { | ||
| --#{$prefix}tag-color: #{$ouds-color-action-disabled}; | ||
| --#{$prefix}tag-background-color: #{$ouds-color-content-on-action-disabled}; | ||
| --#{$prefix}tag-border-color: #{$ouds-color-action-disabled}; | ||
| --#{$prefix}tag-border-width: #{$ouds-tag-input-border-width-default}; | ||
|
|
||
| pointer-events: none; | ||
| } | ||
| } | ||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.