Skip to content

Commit

Permalink
Allow custom properties outside :root
Browse files Browse the repository at this point in the history
This PR disables `custom-property-no-outside-root` which is being set
by `stylelint-config-suitcss`, because we want to support using custom
properties outside root and we no longer support IE11.

Fixes #318
  • Loading branch information
spaceninja committed Feb 5, 2024
1 parent 7972d10 commit 23bfcc6
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- Updated `stylelint-config-standard-scss` to v13
- Updated `stylelint` peer dependency to v16
- Disabled `declaration-block-no-redundant-longhand-properties` (#407)
- Disabled `suitcss/custom-property-no-outside-root` (#318)

# 9.0.0 - 2023-09-19

Expand Down
1 change: 0 additions & 1 deletion __tests__/order/invalid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ a {
text-decoration: none;
color: red;
$scss-variable: red;
// stylelint-disable-next-line suitcss/custom-property-no-outside-root
--custom-property: red;
@include block {
color: red;
Expand Down
4 changes: 3 additions & 1 deletion __tests__/order/order.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('stylelint-order', () => {
});

it('flags warnings', () => {
assert.equal(result.results[0].warnings.length, 4);
assert.equal(result.results[0].warnings.length, 5);
});

it('correct warning text', () => {
Expand All @@ -71,6 +71,7 @@ describe('stylelint-order', () => {
'Expected blockless @include to come before rule (order/order)',
'Expected an empty line before $-variable (scss/dollar-variable-empty-line-before)',
'Expected color to come before text-decoration (order/properties-alphabetical-order)',
'Expected empty line before custom property (custom-property-empty-line-before)',
],
);
});
Expand All @@ -83,6 +84,7 @@ describe('stylelint-order', () => {
'order/order',
'scss/dollar-variable-empty-line-before',
'order/properties-alphabetical-order',
'custom-property-empty-line-before',
],
);
});
Expand Down
1 change: 0 additions & 1 deletion __tests__/order/valid.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
a {
$scss-variable: red;

// stylelint-disable-next-line suitcss/custom-property-no-outside-root
--custom-property: red;

@include mixin;
Expand Down
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ module.exports = {
'scss/at-mixin-pattern': null,
'scss/dollar-variable-pattern': null,
'scss/percent-placeholder-pattern': null,
// these are being set in stylelint-suitcss, but we don't want them
'suitcss/custom-property-no-outside-root': null, // #318
// our rules from here on
'at-rule-disallowed-list': [
['extend', 'import'],
Expand Down

0 comments on commit 23bfcc6

Please sign in to comment.