Repository navigation
Update dependency stylelint-config-cloudfour to v12 - #2548
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: 8b1911a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for cloudfour-patterns ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
renovate
Bot
force-pushed
the
renovate/major-stylelint
branch
16 times, most recently
from
October 14, 2026 01:00
6e9d14b to
cede09f
Compare
renovate
Bot
force-pushed
the
renovate/major-stylelint
branch
from
October 14, 2026 05:42
cede09f to
b5981de
Compare
v12 disables the stylelint-scss rules that conflict with Prettier and enables unit-layout-mappings itself, so the local copies are redundant. The local property-layout-mappings and value-keyword-layout-mappings settings replace the shared config's options, which dropped its overflow-x/overflow-y and offset-anchor/offset-position exceptions. Repeat those alongside the repo's own exceptions.
The local property-layout-mappings and value-keyword-layout-mappings settings only added exceptions for physical border radii and floats, pending Safari 15 support. Every browser we target now supports the logical versions, so drop the local rules and use the shared config's. Converted with `stylelint --fix`, which also removed the physical float fallbacks from the float utilities. Also remove a disable comment for the stylelint-use-logical-spec plugin, which #2522 replaced.
Merged
Closed
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR updates
stylelint-config-cloudfourfrom v11 to v12. v12 now requires logical properties, and it turns off thestylelint-scssformatting rules that conflict with Prettier. We'd already set up both of those in our local Stylelint config. Keeping our own copies would also have thrown away v12's exceptions for properties browsers don't fully support yet, because a local rule replaces the shared config's options instead of merging with them. So this PR removes our local versions and relies on the shared config instead.Our local logical-property rules also had exceptions for physical corner radii and floats, added in #1595 to wait for Safari 15 support. Every browser we target now supports the logical versions, so this PR drops those exceptions and converts the remaining styles with
stylelint --fix. In left-to-right pages, the new properties do exactly what the old ones did, so nothing should look different. The compiled CSS only changes by these renames, plus the physicalfloatfallbacks removed from the float utilities. A changeset is included because the published CSS changes.Screenshots
Testing
All links go to this PR's deploy preview. None of these should look any different from production (https://cloudfour-patterns.netlify.app).
Release notes for stylelint-config-cloudfour v12
cloudfour/stylelint-config-cloudfour (stylelint-config-cloudfour)
v12.0.0Compare Source
.scssfiles (#638).cssfiles are now parsed as CSS, and get core rules thatstylelint-config-standard-scssturns off, such asdeclaration-property-value-no-unknown,at-rule-prelude-no-invalid,media-query-no-invalid, andno-duplicate-selectorsat-rule-disallowed-list(@extendand@import) now only applies to.scssfilesstylelint-config-cloudfour/scssentry point, for applying the Sass rules to other file types, such as Vue components with<style lang="scss">stylelint-scssformatting rules that conflict with Prettier, such asscss/operator-no-newline-after(#638)order/orderno longer sets the position of@include, because since Dart Sass 1.92, an@include's position decides which styles win. Variables and custom properties still come first, and declarations still come before nested rules (#528)property-layout-mappings,unit-layout-mappings, andvalue-keyword-layout-mappings, which require logical properties, units, and keywords, such asmargin-inline-startinstead ofmargin-left(#214)languageOptions.directionalityto left-to-right, top-to-bottom, sostylelint --fixcan convert physical propertiesoverflow-xandoverflow-y(#662), and physical keywords inoffset-anchorandoffset-position(#663), are still allowed, since browsers don't fully support their logical versions yetstylelint-config-standardas a direct dependencyMigrating from v11
All projects: logical properties
This config now requires logical properties, so most projects will see many new warnings for properties like
margin-left,width, andtop. Stylelint can fix all of them automatically:stylelint --fixon your styles. This converts physical properties, units, and keywords to their logical versions, such asmargin-lefttomargin-inline-start,widthtoinline-size, and100vwto100vi.stylelint --fixa second time. Renaming properties can put them out of alphabetical order, and the second run sorts them again.writing-mode: verticalorwriting-mode: sideways. On those elements, logical properties map to different sides, soinline-sizesets the height, not the width. Check that they still look right, or keep the physical properties with astylelint-disablecomment.If your build uses
postcss-preset-envolder than v8, orpostcss-logicalolder than v6, check your compiled CSS after converting. These versions convert logical properties back to physical ones inside[dir="ltr"]and[dir="rtl"]selectors, so those styles only apply if your HTML has adirattribute. To keep logical properties as written, turn that feature off:If your project uses a right-to-left or vertical writing direction, override
languageOptions.directionalitybefore running--fix, as described in the README. To keep using physical properties, turn off the three rules in your config.Projects that lint CSS files
Your
.cssfiles were previously parsed as Sass, which turned off several of Stylelint's CSS validity rules. Those rules now run, so you may see new warnings after upgrading. Most of them point to real bugs, such as a unit on a unitless property (opacity: 0.5em), an invalid value (padding: auto), or a duplicated selector. Fix these in your CSS.The Sass rules no longer run on
.cssfiles, so you can remove any overrides you added to work around them:Remove any rules that start with
scss/, such as"scss/operator-no-newline-after": null.Remove any override of
at-rule-disallowed-list. It used to ban@importin CSS files, but now only applies to Sass files.If you configured
ignoreAtRulesonscss/at-rule-no-unknown, move those options to the coreat-rule-no-unknownrule instead:If your project also lints
.scssfiles, setat-rule-no-unknownin anoverridesentry for.cssfiles instead. Setting it in yourrulesturns it back on for Sass files, where it reports@useand@includeas unknown. See "Changing rules for one file type" in the README.Projects that use PostCSS plugins
If your CSS uses syntax from PostCSS plugins, such as
postcss-mixinsorpostcss-inline-svg, the newly enabled CSS rules may report that syntax as invalid. Add ignore options for the at-rules and functions your plugins provide. For example:Projects that lint Sass files
No config changes are required, but there are two differences to be aware of.
@includecan now go anywhere in a rule, andstylelint --fixno longer moves it. Since Dart Sass 1.92, Sass outputs a mixin's styles where the@includeis written, so its position decides which styles win:Previous versions of this config required the first form, and
--fixwould move an@includeabove your declarations. If your project uses Sass 1.92 or later, that may have changed your compiled CSS. It's worth checking any@includewhose mixin outputs declarations you also set yourself.The
stylelint-scssformatting rules that conflict with Prettier are now turned off. If you turned any of those off in your own config, you can remove those overrides:scss/at-else-closing-brace-newline-afterscss/at-else-closing-brace-space-afterscss/at-else-empty-line-beforescss/at-else-if-parentheses-space-beforescss/at-function-parentheses-space-beforescss/at-if-closing-brace-newline-afterscss/at-if-closing-brace-space-afterscss/at-mixin-parentheses-space-beforescss/dollar-variable-colon-space-afterscss/dollar-variable-colon-space-beforescss/operator-no-newline-afterscss/operator-no-newline-beforescss/operator-no-unspacedVue projects that use
<style lang="scss">Previously, Vue components got the Sass rules. Now they get the CSS rules by default, which report Sass features like
@useand@includeas unknown at-rules. To lint your components as Sass, apply the Sass config to.vuefiles:If your components mix Sass and plain CSS, see the README for the trade-offs.