You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHubβs verified signature.
The key has expired.
π₯ Breaking Change
primer/variables is no longer supported; please use the primer/colors, primer/borders, primer/box-shadow, primer/spacing, and primer/typography rules instead. #50
π Enhancements
The new primer/colors rule enforces color variable usage in color, background-color, and fill 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 in font-family, line-height, and font-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 */returnrules}]}})
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 in primer/box-shadow to prevent multiple warnings for a single value like box-shadow: inset 0 1px $blue (before there would be 4 separate ones!).
π Bug fixes
Use requirePrimerFile() when loading dist/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 in primer/box-shadow to match $btn-active-shadow and $form-control-shadow
Allow color: inherit in primer/colors
Allow $em-spacer-* in padding and margin properties
Allow (and auto-fix!) negative spacer variables in margin properties
Make primer/colors smarter re: background property shorthand values (allowing positions and image url(*) values)
Remove 100% from allowed values for border-radius, and suggest 50% instead
Prohibit negative spacer values in padding properties