Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions polaris-react/src/components/Tag/Tag.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ $button-size: 20px;
background-color: var(--p-color-bg-strong);
border-radius: var(--p-border-radius-1);
color: var(--p-color-text);
line-height: 0;

#{$se23} & {
background-color: var(--p-color-bg-strong);
border: var(--p-border-width-1) solid var(--p-color-bg-strong);
// stylelint-disable-next-line -- se23 6px token
padding: 0 6px;
border-radius: var(--p-border-radius-2);
// stylelint-disable-next-line -- se23 token
color: #303030;
min-height: $height;
}

&.disabled {
transition: none;
Expand All @@ -21,6 +33,18 @@ $button-size: 20px;
svg {
fill: var(--p-color-icon-disabled);
}

#{$se23} & {
transition: none;
background: var(--p-color-bg-disabled);
border-color: var(--p-color-bg-disabled);
color: var(--p-color-text-disabled);

// stylelint-disable-next-line -- se23 ignore s combinator max
svg {
fill: var(--p-color-icon-disabled);
}
}
}

&.clickable {
Expand All @@ -36,6 +60,13 @@ $button-size: 20px;

&:hover {
background: var(--p-color-bg-strong-hover);

#{$se23} & {
// stylelint-disable-next-line -- se23 color-subduedbg-fill
background: #f3f3f3;
// stylelint-disable-next-line -- se23 color-border-subdued
border: var(--p-border-width-1) solid #ebebeb;
}
}

// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
Expand All @@ -49,6 +80,13 @@ $button-size: 20px;

&:active {
background: var(--p-color-bg-strong-hover);

#{$se23} & {
// stylelint-disable-next-line -- se23 color-bg-strong-hover
background: #d4d4d4;
// stylelint-disable-next-line -- se23 color-bg-strong-hover
border: var(--p-border-width-1) solid #d4d4d4;
}
}

&:disabled {
Expand All @@ -66,10 +104,21 @@ $button-size: 20px;

&.removable {
padding-right: 0;

#{$se23} & {
padding-right: 0;
}
}

&.linkable {
padding: 0;

#{$se23} &:hover {
// stylelint-disable-next-line -- se23 color-subduedbg-fill
background: #f3f3f3;
// stylelint-disable-next-line -- se23 color-border-subdued
border: var(--p-border-width-1) solid #ebebeb;
}
}

@media #{$p-breakpoints-sm-up} {
Expand All @@ -88,6 +137,10 @@ $button-size: 20px;
white-space: nowrap;
vertical-align: middle;

#{$se23} & {
padding: 0;
}

@media #{$p-breakpoints-sm-up} {
font-size: var(--p-font-size-75);
padding: var(--p-space-05) 0;
Expand All @@ -104,6 +157,15 @@ $button-size: 20px;
margin: 0 var(--p-space-1);
border-radius: var(--p-border-radius-full);

#{$se23} .removable.linkable & {
margin-left: var(--p-space-05);
}

#{$se23} & {
// stylelint-disable-next-line -- se23 7px token
border-radius: 7px;
}

svg {
fill: var(--p-color-icon);
}
Expand Down Expand Up @@ -148,6 +210,11 @@ $button-size: 20px;
min-height: $height;
padding: 0 var(--p-space-2);

#{$se23} & {
min-height: $height;
padding: 0;
}

.LinkText {
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
@include truncate;
Expand All @@ -157,6 +224,10 @@ $button-size: 20px;
padding-top: var(--p-space-1);
padding-bottom: var(--p-space-1);

#{$se23} & {
padding: 0;
}

@media #{$p-breakpoints-sm-up} {
font-size: var(--p-font-size-75);
padding-top: var(--p-space-05);
Expand All @@ -176,6 +247,11 @@ $button-size: 20px;
&:hover {
background: var(--p-color-bg-strong-hover);
text-decoration: underline;

#{$se23} & {
// stylelint-disable-next-line -- se23 color-subduedbg-fill
background: #f3f3f3;
}
}

&.segmented {
Expand Down
7 changes: 6 additions & 1 deletion polaris-react/src/components/Tag/Tag.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ export default {
} as ComponentMeta<typeof Tag>;

export function Default() {
return <Tag>Wholesale</Tag>;
return (
<LegacyStack>
<Tag>Wholesale</Tag>
<Tag disabled>Wholesale</Tag>
</LegacyStack>
);
}

export function Removable() {
Expand Down