Skip to content

Commit

Permalink
feat(sass): improved css rules for new version of sass (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
Illawind authored Jul 22, 2024
1 parent b7636f0 commit 66f2260
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 51 deletions.
50 changes: 29 additions & 21 deletions assets/scss/_grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,51 @@
}

:root {
@each $breakpoint, $value in $grid-widths {
@if $breakpoint == 0 {
--grid-width: #{$value};
} @else {
@media (min-width: #{map-get($breakpoints, $breakpoint)}) {
& {
@each $breakpoint, $value in $grid-widths {
@if $breakpoint == 0 {
--grid-width: #{$value};
} @else {
@media (min-width: #{map-get($breakpoints, $breakpoint)}) {
--grid-width: #{$value};
}
}
}
}

@each $breakpoint, $value in $grid-max-widths {
@if $breakpoint == 0 {
--grid-max-width: #{$value};
} @else {
@media (min-width: #{map-get($breakpoints, $breakpoint)}) {
& {
@each $breakpoint, $value in $grid-max-widths {
@if $breakpoint == 0 {
--grid-max-width: #{$value};
} @else {
@media (min-width: #{map-get($breakpoints, $breakpoint)}) {
--grid-max-width: #{$value};
}
}
}
}

@each $breakpoint, $value in $grid-columns {
@if $breakpoint == 0 {
--grid-columns: #{$value};
} @else {
@media (min-width: #{map-get($breakpoints, $breakpoint)}) {
& {
@each $breakpoint, $value in $grid-columns {
@if $breakpoint == 0 {
--grid-columns: #{$value};
} @else {
@media (min-width: #{map-get($breakpoints, $breakpoint)}) {
--grid-columns: #{$value};
}
}
}
}

// Gutters
@each $breakpoint, $value in $gutters {
@if $breakpoint == 0 {
--gutter: #{$value};
} @else {
@media (min-width: #{map-get($breakpoints, $breakpoint)}) {
& {
// Gutters
@each $breakpoint, $value in $gutters {
@if $breakpoint == 0 {
--gutter: #{$value};
} @else {
@media (min-width: #{map-get($breakpoints, $breakpoint)}) {
--gutter: #{$value};
}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions assets/scss/mixins/_grid.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
@mixin grid {
@include grid-gap;

display: grid;
width: var(--grid-width);
max-width: var(--grid-max-width);
margin: 0 auto;
grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr));

@include grid-gap;
}

@mixin grid-gap {
Expand Down
3 changes: 2 additions & 1 deletion components/molecules/VButton/VButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ export default defineComponent({
.root {
@include v-button-default-css-vars($v-button);
@include theme-variants;
position: var(--v-button-position, relative);
display: var(--v-button-display, inline-flex);
Expand All @@ -165,6 +164,8 @@ export default defineComponent({
color: var(--v-button-color, var(--theme-foreground-color));
text-decoration: initial;
@include theme-variants;
// PROPS STYLE
&--icon-last {
flex-direction: row-reverse;
Expand Down
1 change: 1 addition & 0 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export default defineNuxtConfig({
preprocessorOptions: {
scss: {
additionalData: hoistUseStatements(`@import "~/assets/scss/_style-resources.scss";`),
quietDeps: true,
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"nuxt": "^3.12.3",
"postcss-html": "^1.7.0",
"prettier": "^3.3.2",
"sass": "^1.77.7",
"sass": "^1.77.8",
"stylelint": "^16.6.1",
"stylelint-config-css-modules": "^4.4.0",
"stylelint-config-idiomatic-order": "^10.0.0",
Expand Down
52 changes: 26 additions & 26 deletions pnpm-lock.yaml

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

0 comments on commit 66f2260

Please sign in to comment.