Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
fcc3152
Enable custom-property-disallowed-list for z-index
lgriffee Apr 14, 2023
dfabc43
Enable custom-property-disallowed-list for color
lgriffee Apr 14, 2023
ee13af2
Enable custom-property-disallowed-list for layout
lgriffee Apr 14, 2023
2681c3e
Enable custom-property-disallowed-list for space
lgriffee Apr 14, 2023
b3666bb
Enable custom-property-disallowed-list for shape
lgriffee Apr 14, 2023
a69338e
Enable custom-property-disallowed-list for depth
lgriffee Apr 14, 2023
3544108
Remove custom property test from global-disallowed-list
lgriffee Apr 14, 2023
873f2b0
Alpha order disallowedVar groups
lgriffee Apr 14, 2023
d2f8950
Create new rule doc pages for custom-property-disallowed-list token g…
lgriffee Apr 14, 2023
dae3441
Update rule doc pages for global-disallowed-list token groups
lgriffee Apr 14, 2023
acea51f
Fix failing lines with new stylelint rules
lgriffee Apr 14, 2023
145654e
Add changeset
lgriffee Apr 14, 2023
97b492b
Update .changeset/khaki-walls-wash.md
lgriffee Apr 17, 2023
9272b07
Merge branch 'main' of https://github.com/Shopify/polaris into enable…
lgriffee Apr 17, 2023
d0a2979
Update changeset
lgriffee Apr 17, 2023
24712c8
Add deprecated v10 custom properties to `stylelint-polaris` (#8549)
lgriffee Apr 13, 2023
808acef
Revert v10 deprecated custom properties added
lgriffee Apr 17, 2023
9938f49
Remove extra changeset
lgriffee Apr 17, 2023
682e78a
Update polaris.shopify.com/content/tools/stylelint-polaris/rules/layo…
lgriffee Apr 17, 2023
3ea1658
Update .changeset/khaki-walls-wash.md
lgriffee Apr 17, 2023
a7af0db
Update global-disallowed-list token category descriptions
lgriffee Apr 17, 2023
a4360a0
Merge branch 'main' of https://github.com/Shopify/polaris into enable…
lgriffee Apr 17, 2023
5736dc8
Remove failing Menu test
lgriffee Apr 17, 2023
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
7 changes: 7 additions & 0 deletions .changeset/khaki-walls-wash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@shopify/stylelint-polaris': major
'@shopify/polaris': minor
'polaris.shopify.com': minor
---

Enabled the `custom-property-disallowed-list` rule and added deprecated v10 custom properties.
4 changes: 2 additions & 2 deletions polaris-react/src/components/AlphaFilters/AlphaFilters.scss
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@

.AddFilterActivatorMultiple {
position: sticky;
z-index: var(--p-z-1);
z-index: var(--p-z-index-1);
top: 0;
right: 0;
display: flex;
Expand Down Expand Up @@ -227,7 +227,7 @@
.MultiplePinnedFilterClearAll {
transform: translateX(-8px);
position: relative;
z-index: var(--p-z-1);
z-index: var(--p-z-index-1);
margin-left: 0;
padding-right: var(--p-space-4);
}
Expand Down
4 changes: 2 additions & 2 deletions polaris-react/src/components/AlphaTabs/AlphaTabs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
&:not([aria-disabled='true']):active {
background-color: var(--p-color-bg-active);
color: var(--p-color-text);
z-index: var(--p-z-1);
z-index: var(--p-z-index-1);
}

path {
Expand Down Expand Up @@ -257,7 +257,7 @@

&:not([aria-disabled='true']):active {
background-color: var(--p-color-bg-active);
z-index: var(--p-z-1);
z-index: var(--p-z-index-1);
}

&[aria-disabled='true'] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ $spinner-size: 20px;
z-index: var(--p-z-index-1);
top: 56px;
width: 100vw;
box-shadow: var(--p-shadow-top-bar);
box-shadow: var(--p-shadow-sm);
}

.IndexFilters.IndexFiltersStickyFlush {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,23 +121,6 @@ describe('<Menu />', () => {
expect(menu).toContainReactComponent(Message);
});

describe('isFullHeight', () => {
it('passes isFullHeight to popover as false if menu is not provided a message', () => {
const {message, ...rest} = defaultProps;
const menu = mountWithApp(<Menu {...rest} open />);

expect(menu).toContainReactComponent(Popover, {fullHeight: false});
});

it('passes isFullHeight to popover as true if menu is provided a message', () => {
const menu = mountWithApp(<Menu {...defaultProps} open />);

expect(menu).toContainReactComponent(Popover, {
fullHeight: true,
});
});
});

describe('accessibilityLabel', () => {
it('passes accessibilityLabel to the popover activator', () => {
const menu = mountWithApp(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: colors/custom-property-disallowed-list
description: Disallows use of legacy color custom properties.
keywords:
- stylelint
- colors
- colors rules
---

```diff
// Do
+ color: var(--p-color-text-caution);
// Don't
- color: var(--p-text-warning);
```
Original file line number Diff line number Diff line change
@@ -1,23 +1,12 @@
---
title: colors/global-disallowed-list
description: Disallows use of legacy color custom properties and mixin map data.
description: Disallows use of legacy color Sass APIs.
keywords:
- stylelint
- colors
- colors rules
---

Disallows use of legacy custom properties.

```diff
// Do
+ border: transparent;
// Don't
- border: var(--p-override-transparent);
```

Disallows use of legacy mixin map data.

```diff
// Don't
- @type map $filter-palette-data: $polaris-color-filters;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: depth/custom-property-disallowed-list
description: Disallows use of legacy shadow custom properties.
keywords:
- stylelint
- depth
- depth rules
---

```diff
// Do
+ box-shadow: var(--p-shadow-md);
// Don't
- box-shadow: var(--p-shadow-deep)
```
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
---
title: depth/global-disallowed-list
description: Disallows use of legacy shadow custom properties and Sass mixin data.
description: Disallows use of legacy depth Sass APIs.
keywords:
- stylelint
- depth
- depth rules
---

```diff
// Do
+ box-shadow: var(--p-shadow-card);
// Don't
- box-shadow: var(--p-card-shadow);
- @type map $depth-data: $shadows-data;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: layout/custom-property-disallowed-list
description: Disallows use of legacy layout custom properties.
keywords:
- stylelint
- layout
- layout rules
---

```diff
// Do
+ <Checkbox />
// Don't
- height: var(--p-choice-size);
```
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: layout/global-disallowed-list
description: Disallows use of legacy custom properties and Sass mixin map data.
description: Disallows use of legacy layout Sass APIs.
keywords:
- stylelint
- layout
Expand All @@ -9,7 +9,7 @@ keywords:

```diff
// Do
+ <Checkbox />
+ width: 240px !default;
// Don't
- height: var(--p-choice-size);
- width: $navigation-width;
```
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: motion/global-disallowed-list
description: Disallows use of legacy Polaris motion tokens.
description: Disallows use of legacy motion Sass APIs.
keywords:
- stylelint
- motion
Expand All @@ -9,7 +9,7 @@ keywords:

```diff
// Do
+ transition: var(--p-duration-100) var(--p-ease);
+ transition: var(--p-duration-500) var(--p-ease);
// Don't
- transition: var(--p-duration-1-0-0) var(--p-ease);
- duration: $skeleton-shimmer-duration var(--p-ease);
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: shape/custom-property-disallowed-list
description: Disallows use of legacy shape custom properties.
keywords:
- stylelint
- shape
- shape rules
---

```diff
// Do
+ border-radius: var(--p-border-radius-2);
// Don't
- border-radius: var(--p-border-radius-large);
```

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: spacing/custom-property-disallowed-list
description: Disallows use of legacy spacing custom properties.
keywords:
- stylelint
- spacing
- spacing rules
---

```diff
// Do
+ margin-bottom: var(--p-space-025);
// Don't
- margin-bottom: var(--p-choice-margin);
```
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
---
title: spacing/global-disallowed-list
description: Disallows use of legacy spacing custom properties and Sass mixin data.
description: Disallows use of legacy spacing Sass APIs.
keywords:
- stylelint
- spacing
- spacing rules
---

```diff
// Do
+ margin-bottom: var(--p-space-1);
// Don't
- margin-bottom: var(--p-text-field-spinner-offset);
- @type map $spacing-data: $polaris-spacing;
```
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: typography/global-disallowed-list
description: Disallows use of legacy Polaris typography tokens and mixin map data.
description: Disallows use of legacy typography Sass APIs.
keywords:
- stylelint
- typography
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: z-index/custom-property-disallowed-list
description: Disallows use of legacy z-index custom properties.
keywords:
- stylelint
- z-index
- z-index rules
---

```diff
// Do
+ z-index: var(--p-z-index-1);
// Don't
- z-index: var(--p-z-1);
```
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
---
title: z-index/global-disallowed-list
description: Disallows the use of legacy z-index custom properties and Sass mixin data.
description: Disallows use of legacy z-index Sass APIs.
keywords:
- stylelint
- z-index
- z-index rules
---

```diff
// Do
+ z-index: var(--p-z-1);
// Don't
- z-index(toast, $fixed-element-stacking-order);
- @type map $elevation-data: $global-elements;
```
Loading