Skip to content

Commit

Permalink
fix(css): add :where() selector to reduce data-flex specificity
Browse files Browse the repository at this point in the history
- wrapped all data-flex column selectors with :where() pseudo-class
- reduces specificity weight of grid column classes from [0,1,1] to [0,0,1]
- affects column layouts from cols-2 through cols-12
- changes applied to both scss and compiled css files
  • Loading branch information
shawnsandy committed Nov 5, 2024
1 parent 0684588 commit 0ec2256
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
22 changes: 11 additions & 11 deletions libs/react/fpkit/src/sass/_grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,47 +42,47 @@
justify-content: end;
}

[data-flex~='cols-2'] {
:where([data-flex~='cols-2']) {
--col-w: 50%;
}

[data-flex~='cols-3'] {
:where([data-flex~='cols-3']) {
--col-w: 33%;
}

[data-flex~='cols-4'] {
:where([data-flex~='cols-4']) {
--col-w: 25%;
}

[data-flex~='cols-5'] {
:where([data-flex~='cols-5']) {
--col-w: 20%;
}

[data-flex~='cols-6'] {
:where([data-flex~='cols-6']) {
--col-w: 16%;
}

[data-flex~='cols-7'] {
:where([data-flex~='cols-7']) {
--col-w: 14%;
}

[data-flex~='cols-8'] {
:where([data-flex~='cols-8']) {
--col-w: 12%;
}

[data-flex~='cols-9'] {
:where([data-flex~='cols-9']) {
--col-w: 11%;
}

[data-flex~='cols-10'] {
:where([data-flex~='cols-10']) {
--col-w: 10%;
}

[data-flex~='cols-11'] {
:where([data-flex~='cols-11']) {
--col-w: 9%;
}

[data-flex~='cols-12'] {
:where([data-flex~='cols-12']) {
--col-w: 8%;
}

Expand Down
22 changes: 11 additions & 11 deletions libs/react/fpkit/src/styles/index.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0ec2256

Please sign in to comment.