Releases: primer/stylelint-config
Releases · primer/stylelint-config
v9.3.3
Patch Changes
a339c69
#81 Thanks @BinaryMuse! - Update globby to v11
v9.3.2
Patch Changes
-
d18cfbf
#79 Thanks @BinaryMuse! - Add additinal verbose logging tono-undefined-vars
-
d18cfbf
#79 Thanks @BinaryMuse! - Fix handling of edge-cases inno-undefined-vars
-
bb07673
#76 Thanks @BinaryMuse! - Set the default verbose option forno-scale-colors
to false
v9.3.0
🐛 Bug Fixes
- The
no-undefined-vars
rule now understands variables defined with@include color-mode-var(...)
- The
no-undefined-vars
rule now checks the last two parameters of the@include color-mode-var(...)
mixin to ensure any CSS variables referenced are defined
🚀 Enhancements
- Added
no-scale-colors
rule to ensure bare scale colors (which begin with--color-scale-
or--color-auto-
) are not used as property values
v9.2.4
🐛 Bug fixes
- Fix variable recognition when fallback values are present
v9.2.3
🐛 Bug fixes
- Fix
no-undefined-vars
to support values with CSS variable fallbacks
v9.2.2
🐛 Bug fixes
- Update
string.prototype.matchall
to fix a transitive dependency issue
v9.2.1
v9.2.0
v9.1.0
v9.0.0 (October 29, 2019)
💥 Breaking Change
primer/variables
is no longer supported; please use theprimer/colors
,primer/borders
,primer/box-shadow
,primer/spacing
, andprimer/typography
rules instead. #50
🚀 Enhancements
- The new
primer/colors
rule enforces color variable usage incolor
,background-color
, andfill
properties - The new
primer/borders
rule enforces border variable usage in border CSS props - The new
primer/box-shadow
rule enforces$box-shadow*
variables - The new
primer/spacing
rule enforces$spacer-*
variables in margin and padding props - The new
primer/typography
rule enforces typography variable use infont-family
,line-height
, andfont-weight
props - Variable replacements for autofixing are automatically detected in variable data from Primer CSS (see: primer/css#949) #52
- It is now possible to define variable rules using functions that take the variables, as in:
module.exports = createVariableRule('primer/whatever', ({variables}) => { /* do something with variables here */ })
- It's also now possible to provide rule overrides in local stylelint configs as functions:
module.exports = { extends: 'stylelint-config-primer', rules: { 'primer/colors': [true, { rules: ({variables, rules}) => { /* do something with variables and/or rules here */ return rules }] } })
- This release adds support for an optional
singular: true
flag to rule configs, which skips the parsing of individual values in the matched properties. We use this inprimer/box-shadow
to prevent multiple warnings for a single value likebox-shadow: inset 0 1px $blue
(before there would be 4 separate ones!).
🐛 Bug fixes
- Use
requirePrimerFile()
when loadingdist/variables.json
so that we can access the right file when running within the@primer/css
repo. - Walk only declarations (
prop: value
) in rules (blocks with selectors, not@rules
), and skip linting for declarations nested in@each
,@for
,@function
, and@mixin
blocks, since those can define their own variables and we can't reliably assert their values. - Allow
$*-shadow
variable patterns inprimer/box-shadow
to match$btn-active-shadow
and$form-control-shadow
- Allow
color: inherit
inprimer/colors
- Allow
$em-spacer-*
inpadding
andmargin
properties - Allow (and auto-fix!) negative spacer variables in
margin
properties - Make
primer/colors
smarter re:background
property shorthand values (allowing positions and imageurl(*)
values) - Remove
100%
from allowed values forborder-radius
, and suggest50%
instead - Prohibit negative spacer values in
padding
properties - Allow
$h000-size
for marketing