Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SASS/SCSS "slash-div"-Deprecation (https://sass-lang.com/document… #77

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
node_modules
npm-debug.log
src
.editorconfig
.gitignore
.sass-lint.yml
Expand Down
45 changes: 6 additions & 39 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "lib/index.scss",
"repository": {
"type": "git",
"url": "https://github.com/sierra-library/sierra.git"
"url": "git+https://github.com/webksde/sierra.git"
},
"keywords": [
"scss",
Expand All @@ -19,49 +19,16 @@
"lightweight",
"frontend"
],
"author": {
"name": "Sierra-library",
"url": "https://github.com/sierra-library"
},
"author": "Sierra-library (https://github.com/sierra-library)",
"licenses": [
{
"type": "GNU General Public License v2.0."
}
],
"private": false,
"devDependencies": {
"@commitlint/cli": "7",
"@commitlint/config-conventional": "7",
"autoprefixer": "8",
"commitizen": "3",
"cpx": "1",
"cz-conventional-changelog": "2",
"husky": "1",
"node-sass": "4",
"nodemon": "1",
"np": "3",
"postcss-cli": "2"
},
"browserslist": [
"> 1%",
"last 2 versions"
],
"scripts": {
"publish": "npm run build",
"build": "npm run build:prod && npm run build:dev && cpx 'src/**/*.*' ./lib",
"build:prod": "node-sass --include-path scss src/index.scss dist/sierra.min.css --output-style compressed && postcss --use autoprefixer dist/sierra.min.css -d dist/",
"build:dev": "node-sass --include-path scss src/index.scss dist/sierra.css && postcss --use autoprefixer dist/sierra.css -d dist/",
"co": "git cz",
"watch": "nodemon -e scss -x \"npm run build\""
"bugs": {
"url": "https://github.com/sierra-library/sierra/issues"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
}
"homepage": "https://github.com/sierra-library/sierra#readme",
"license": "ISC"
}
2 changes: 1 addition & 1 deletion src/components/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ input:-webkit-autofill {
&-icon {
fill: $c-form-input-icon;
height: $size-form-input-icon;
margin-top: -$size-form-input-icon / 2;
margin-top: -$size-form-input-icon * 0.5;
position: absolute;
right: $m-medium;
top: 50%;
Expand Down
14 changes: 7 additions & 7 deletions src/components/_loading-spinner.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
display: block;
height: $size-loading-spinner;
left: 50%;
margin-left: -$size-loading-spinner / 2;
margin-top: -$size-loading-spinner / 2;
margin-left: -$size-loading-spinner * 0.5;
margin-top: -$size-loading-spinner * 0.5;
position: fixed;
top: 50%;
width: $size-loading-spinner;
Expand All @@ -38,7 +38,7 @@
animation: translateBall1 1s infinite;
left: 0;
top: 0;
transform: translate3d($size-loading-spinner-inner / 2, $size-loading-spinner-inner / 2, 0);
transform: translate3d($size-loading-spinner-inner * 0.5, $size-loading-spinner-inner * 0.5, 0);
}

&:nth-child(2) {
Expand Down Expand Up @@ -89,7 +89,7 @@
}

50% {
transform: translate3d($size-loading-spinner-inner / 2, $size-loading-spinner-inner / 2, 0);
transform: translate3d($size-loading-spinner-inner * 0.5, $size-loading-spinner-inner * 0.5, 0);
}

100% {
Expand All @@ -102,7 +102,7 @@
}

50% {
transform: translate3d(-$size-loading-spinner-inner / 2, $size-loading-spinner-inner / 2, 0);
transform: translate3d(-$size-loading-spinner-inner * 0.5, $size-loading-spinner-inner * 0.5, 0);
}

100% {
Expand All @@ -116,7 +116,7 @@
}

50% {
transform: translate3d(-$size-loading-spinner-inner / 2, -$size-loading-spinner-inner / 2, 0);
transform: translate3d(-$size-loading-spinner-inner * 0.5, -$size-loading-spinner-inner * 0.5, 0);
}

100% {
Expand All @@ -130,7 +130,7 @@
}

50% {
transform: translate3d($size-loading-spinner-inner / 2, -$size-loading-spinner-inner / 2, 0);
transform: translate3d($size-loading-spinner-inner * 0.5, -$size-loading-spinner-inner * 0.5, 0);
}

100% {
Expand Down
8 changes: 4 additions & 4 deletions src/components/_tag.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@

// triangle arrow
&::before {
border-bottom: ($lh-tag / 2) + $p-tag solid transparent;
border-bottom: ($lh-tag * 0.5) + $p-tag solid transparent;
border-left: $p-tag solid $bg-tag;
border-top: ($lh-tag / 2) + $p-tag solid transparent;
border-top: ($lh-tag * 0.5) + $p-tag solid transparent;
content: '';
height: 0;
position: absolute;
Expand All @@ -53,9 +53,9 @@
border-radius: 100%;
content: '';
height: $size-tag-dot;
margin-top: -$size-tag-dot / 2;
margin-top: -$size-tag-dot * 0.5;
position: absolute;
right: -$size-tag-dot / 2;
right: -$size-tag-dot * 0.5;
top: 50%;
width: $size-tag-dot;
}
Expand Down
4 changes: 2 additions & 2 deletions src/grid/_grid-framework.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
position: relative;
width: 100%;
min-height: 1px; // Prevent columns from collapsing when empty
padding-right: ($gutter / 2);
padding-left: ($gutter / 2);
padding-right: ($gutter * 0.5);
padding-left: ($gutter * 0.5);
}

@each $breakpoint in map-keys($breakpoints) {
Expand Down
20 changes: 11 additions & 9 deletions src/grid/_grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
//
// Generate semantic grid columns with these mixins.

@use "sass:math";

@mixin make-container() {
width: 100%;
padding-right: ($grid-gutter-width / 2);
padding-left: ($grid-gutter-width / 2);
padding-right: ($grid-gutter-width * 0.5);
padding-left: ($grid-gutter-width * 0.5);
margin-right: auto;
margin-left: auto;
}
Expand All @@ -23,8 +25,8 @@
@mixin make-row() {
display: flex;
flex-wrap: wrap;
margin-right: ($grid-gutter-width / -2);
margin-left: ($grid-gutter-width / -2);
margin-right: math.div($grid-gutter-width, -2);
margin-left: math.div($grid-gutter-width, -2);
}

@mixin make-col-ready() {
Expand All @@ -34,19 +36,19 @@
// later on to override this initial width.
width: 100%;
min-height: 1px; // Prevent collapsing
padding-right: ($grid-gutter-width / 2);
padding-left: ($grid-gutter-width / 2);
padding-right: ($grid-gutter-width * 0.5);
padding-left: ($grid-gutter-width * 0.5);
}

@mixin make-col($size, $columns: $grid-columns) {
flex: 0 0 percentage($size / $columns);
flex: 0 0 percentage(math.div($size, $columns));
// Add a `max-width` to ensure content within each column does not blow out
// the width of the column. Applies to IE10+ and Firefox. Chrome and Safari
// do not appear to require this.
max-width: percentage($size / $columns);
max-width: percentage(math.div($size, $columns));
}

@mixin make-col-offset($size, $columns: $grid-columns) {
$num: $size / $columns;
$num: math.div($size, $columns);
margin-left: if($num == 0, 0, percentage($num));
}
5 changes: 4 additions & 1 deletion src/utils/_breakpoints.scss
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@
@content;
}
} @else {
@content;
// Largest (last) breakpoint
@media (max-width: (map-get($grid-breakpoints, $name) - 1px)) {
@content;
}
}
}

Expand Down
12 changes: 6 additions & 6 deletions src/utils/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
background-color: $bgc-container;
margin: 0 auto;
max-width: $mwi-container;
padding-left: $w-gutter / 2;
padding-right: $w-gutter / 2;
padding-left: $w-gutter * 0.5;
padding-right: $w-gutter * 0.5;
width: 100%;
}

Expand All @@ -35,8 +35,8 @@
}
margin: 0 auto;
max-width: $mwi-container-medium;
padding-left: $w-gutter / 2;
padding-right: $w-gutter / 2;
padding-left: $w-gutter * 0.5;
padding-right: $w-gutter * 0.5;
}

.container-small {
Expand All @@ -46,6 +46,6 @@
}
margin: 0 auto;
max-width: $mwi-container-small;
padding-left: $w-gutter / 2;
padding-right: $w-gutter / 2;
padding-left: $w-gutter * 0.5;
padding-right: $w-gutter * 0.5;
}