Skip to content

Commit

Permalink
Merge branch 'hotfix/3.5.1'
Browse files Browse the repository at this point in the history
* hotfix/3.5.1:
  build(deps): reinstall npm packages
  fix(package): update project version number from `3.5.0` to `3.5.1`
  style(sass): format the `media` mixin code using double quotes, spaces and line breaks
  style(sass): sort sass imports alphabetically
  fix(sass): correct assignment of `$dimension` parameter in `media` mixin
  fix(sass): use `math.unit` instead of `unit` to avoid deprecation warnings
  fix(sass): use `math.is-unitless` instead of `unitless` to avoid deprecation warnings
  fix(sass): use `map.keys` instead of `map-keys` to avoid deprecation warnings
  fix(sass): use `map.inspect` instead of `inspect` to avoid deprecation warnings
  fix(sass): use `map.has-key` instead of `map-has-key` to avoid deprecation warnings
  fix(sass): use `map.get` instead of `map-get` to avoid deprecation warnings
  fix(sass): broken responsive styles
  fix(sass): use `meta.list` instead of `list` to avoid deprecation warnings
  fix(sass): use `meta.type-of` instead of `type-of` to avoid deprecation warnings
  fix(sass): use `meta.variable-exists` instead of `variable-exists` to avoid deprecation warnings
  fix(sass): rename `variable_exists` function to `variable-exists`
  fix(sass): use `color.mix` instead of `mix` to avoid deprecation warnings
  fix(sass): use `@forward` and `@use` instead of `@import` to avoid deprecation warnings
  • Loading branch information
beatrizsmerino committed Oct 22, 2024
2 parents ae54869 + 9123e77 commit dc605a5
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 28 deletions.
16 changes: 8 additions & 8 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "3.5.0",
"version": "3.5.1",
"private": true,
"name": "vue-users",
"description": "Vue app that get/set a list of random users from an API.",
Expand Down
3 changes: 2 additions & 1 deletion src/assets/scss/settings/settings-colors.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// SETTINGS
// COLORS
// ------------------
@use "sass:color";

// GRAY SCALE
// =================================================
Expand All @@ -19,5 +20,5 @@ $color-success: #008080;
// =================================================
$color-brand-1: #42b883;
$color-brand-2: #35495e;
$color-brand-2--dark: mix($color-black, $color-brand-2, 20%);
$color-brand-2--dark: color.mix($color-black, $color-brand-2, 20%);
$color-gradient: linear-gradient($color-brand-1, $color-brand-2);
8 changes: 4 additions & 4 deletions src/assets/scss/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

// SETTINGS
// =================================================
@import "settings/settings-breakpoints";
@import "settings/settings-colors";
@import "settings/settings-fonts";
@forward "settings/settings-breakpoints";
@forward "settings/settings-colors";
@forward "settings/settings-fonts";

// TOOLS
// =================================================
@import "tools/tools-media";
@forward "tools/tools-media";
31 changes: 18 additions & 13 deletions src/assets/scss/tools/tools-media.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@
// MIXIN
// media queries
// ------------------
@use "sass:list";
@use "sass:map";
@use "sass:math";
@use "sass:meta";
@use "../settings/settings-breakpoints" as *;

@function contains($list, $item) {
@return index($list, $item) != null;
@return list.index($list, $item) != null;
}

@mixin media($breakpoint, $rule: "max", $dimension: "width") {
Expand All @@ -17,34 +22,34 @@
}

@if not contains($dimensions, $dimension) {
$rule: "width";
$dimension: "width";
}

@if type-of($breakpoint) ==number {
@if unitless($breakpoint) {
@media (#{$rule}-#{$dimension}: #{$breakpoint + 'px'}) {
@if meta.type-of($breakpoint) == number {
@if math.is-unitless($breakpoint) {
@media (#{$rule}-#{$dimension}: #{$breakpoint + "px"}) {
@content;
}
} @else if contains($units, unit($breakpoint)) {
} @else if contains($units, math.unit($breakpoint)) {
@media (#{$rule}-#{$dimension}: #{$breakpoint}) {
@content;
}
} @else {
@error 'Invalid units provided';
@error "Invalid units provided";
}
} @else if variable_exists(breakpoints) {
@if map-has-key($breakpoints, $breakpoint) {
@media (#{$rule}-#{$dimension}: #{inspect(map-get($breakpoints, $breakpoint))}) {
} @else if meta.variable-exists(breakpoints) {
@if map.has-key($breakpoints, $breakpoint) {
@media (#{$rule}-#{$dimension}: #{meta.inspect(map.get($breakpoints, $breakpoint))}) {
@content;
}
} @else {
@error 'Unfortunately, no value could be retrieved from `#{$breakpoint}`. '+'Available breakpoints are: #{map-keys($breakpoints)}.';
@error "Unfortunately, no value could be retrieved from `#{$breakpoint}`. " + "Available breakpoints are: #{map.keys($breakpoints)}.";
}
} @else if variable_exists(breakpoint) {
} @else if meta.variable-exists(breakpoint) {
@media (#{$rule}-#{$dimension}: #{$breakpoint}) {
@content;
}
} @else {
@error 'Neither $breakpoints map nor variable provided are defined';
@error "Neither $breakpoints map nor variable provided are defined";
}
}
2 changes: 1 addition & 1 deletion vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = {
"css": {
"loaderOptions": {
"sass": {
"additionalData": `@import "@/assets/scss/styles.scss";`,
"additionalData": `@use "@/assets/scss/styles.scss" as *;`,
},
},
},
Expand Down

0 comments on commit dc605a5

Please sign in to comment.