Skip to content

Commit ef38140

Browse files
authored
[LegacyTabs] Consolidate se23 styles and logic (#10231)
### WHY are these changes introduced? Resolves #9946. ### WHAT is this pull request doing? Consolidates se23 beta styles and logic for `LegacyTabs`. ### How to 🎩 [Storybook](https://5d559397bae39100201eedc1-yxlghuvhen.chromatic.com/?path=/story/all-components-legacytabs--all) [Prod Storybook](https://storybook.polaris.shopify.com/?path=/story/all-components-legacytabs--all&globals=polarisSummerEditions2023:true) 🖥 [Local development instructions](https://github.com/Shopify/polaris/blob/main/README.md#local-development) 🗒 [General tophatting guidelines](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md) 📄 [Changelog guidelines](https://github.com/Shopify/polaris/blob/main/.github/CONTRIBUTING.md#changelog) ### 🎩 checklist - [x] Tested on [mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing) - [x] Tested on [multiple browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers) - [ ] Tested for [accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md) - [ ] Updated the component's `README.md` with documentation changes - [ ] [Tophatted documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md) changes in the style guide
1 parent 799ce67 commit ef38140

File tree

2 files changed

+15
-51
lines changed

2 files changed

+15
-51
lines changed

polaris-react/src/components/LegacyTabs/LegacyTabs.scss

Lines changed: 13 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ $item-vertical-padding: $item-min-height * 0.5;
2121

2222
.Title {
2323
width: 100%;
24-
padding: var(--p-space-2) var(--p-space-4);
24+
padding: var(--p-space-1_5-experimental) var(--p-space-3);
2525
}
2626
}
2727

@@ -58,24 +58,21 @@ $item-vertical-padding: $item-min-height * 0.5;
5858
text-decoration: none;
5959

6060
.Title {
61-
font-weight: var(--p-font-weight-regular);
62-
color: var(--p-color-text);
61+
font-weight: var(--p-font-weight-semibold);
62+
color: var(--p-color-text-primary);
6363
background-color: transparent;
64+
6465
// stylelint-disable-next-line selector-max-specificity -- generated by polaris-migrator DO NOT COPY
6566
&::before {
6667
background-color: var(--p-color-bg-strong-hover);
6768
}
68-
69-
#{$se23} & {
70-
color: var(--p-color-text-primary);
71-
font-weight: var(--p-font-weight-semibold);
72-
}
7369
}
7470
}
7571

7672
&:active {
7773
.Title {
7874
background-color: transparent;
75+
7976
// stylelint-disable-next-line selector-max-specificity -- generated by polaris-migrator DO NOT COPY
8077
&::before {
8178
background: var(--p-color-bg-strong-active);
@@ -85,13 +82,8 @@ $item-vertical-padding: $item-min-height * 0.5;
8582

8683
&:focus-visible {
8784
.Title {
88-
font-weight: var(--p-font-weight-regular);
89-
color: var(--p-color-text);
90-
91-
#{$se23} & {
92-
color: var(--p-color-text-primary);
93-
font-weight: var(--p-font-weight-semibold);
94-
}
85+
font-weight: var(--p-font-weight-semibold);
86+
color: var(--p-color-text-primary);
9587
}
9688

9789
&:not(:active) {
@@ -109,8 +101,8 @@ $item-vertical-padding: $item-min-height * 0.5;
109101
}
110102

111103
.Tab-selected {
112-
font-weight: var(--p-font-weight-regular);
113-
color: var(--p-color-text);
104+
font-weight: var(--p-font-weight-semibold);
105+
color: var(--p-color-text-primary);
114106

115107
&:focus .Title {
116108
outline: var(--p-border-width-3) solid transparent;
@@ -122,20 +114,11 @@ $item-vertical-padding: $item-min-height * 0.5;
122114

123115
.Title {
124116
outline: var(--p-border-width-3) solid transparent;
125-
color: var(--p-color-text);
117+
color: var(--p-color-text-primary);
126118

127119
&::before {
128120
background: var(--p-color-bg-primary);
129121
}
130-
131-
#{$se23} & {
132-
color: var(--p-color-text-primary);
133-
}
134-
}
135-
136-
#{$se23} & {
137-
color: var(--p-color-text-primary);
138-
font-weight: var(--p-font-weight-semibold);
139122
}
140123
}
141124

@@ -144,9 +127,10 @@ $item-vertical-padding: $item-min-height * 0.5;
144127
@include focus-ring;
145128
border-radius: var(--p-border-radius-1);
146129
display: block;
147-
padding: var(--p-space-2) var(--p-space-4);
130+
padding: var(--p-space-1_5-experimental) var(--p-space-3);
148131
min-width: $item-min-width;
149-
color: var(--p-color-text-subdued);
132+
color: var(--p-color-text-primary);
133+
font-weight: var(--p-font-weight-semibold);
150134

151135
&::before {
152136
content: '';
@@ -158,12 +142,6 @@ $item-vertical-padding: $item-min-height * 0.5;
158142
border-top-left-radius: var(--p-border-radius-1);
159143
border-top-right-radius: var(--p-border-radius-1);
160144
}
161-
162-
#{$se23} & {
163-
color: var(--p-color-text-primary);
164-
font-weight: var(--p-font-weight-semibold);
165-
padding: var(--p-space-1_5-experimental) var(--p-space-3);
166-
}
167145
}
168146

169147
.titleWithIcon {

polaris-react/src/components/LegacyTabs/LegacyTabs.tsx

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
import React, {PureComponent} from 'react';
2-
import {
3-
HorizontalDotsMinor,
4-
CaretDownMinor,
5-
ChevronDownMinor,
6-
} from '@shopify/polaris-icons';
2+
import {HorizontalDotsMinor, ChevronDownMinor} from '@shopify/polaris-icons';
73

84
import {Box} from '../Box';
95
import {Icon} from '../Icon';
106
import {Popover} from '../Popover';
117
import {classNames} from '../../utilities/css';
128
import {useI18n} from '../../utilities/i18n';
13-
import {UseFeatures} from '../../utilities/features';
149

1510
import type {TabDescriptor} from './types';
1611
import {getVisibleAndHiddenTabIndices} from './utilities';
@@ -135,16 +130,7 @@ class TabsInner extends PureComponent<CombinedProps, State> {
135130
const disclosureButtonContent = hasCustomDisclosure ? (
136131
<>
137132
{disclosureText}
138-
<UseFeatures>
139-
{({polarisSummerEditions2023}) => (
140-
<Icon
141-
source={
142-
polarisSummerEditions2023 ? ChevronDownMinor : CaretDownMinor
143-
}
144-
tone="subdued"
145-
/>
146-
)}
147-
</UseFeatures>
133+
<Icon source={ChevronDownMinor} tone="subdued" />
148134
</>
149135
) : (
150136
<Icon source={HorizontalDotsMinor} tone="subdued" />

0 commit comments

Comments
 (0)