Skip to content

Commit

Permalink
[dmitry-lavrik#56] fixes for support gulp-sass^5.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
maxlanser committed Jul 4, 2022
1 parent b1131d0 commit 282c890
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ function Build(settings, patterns) {
let base = require('./system/base.js');
let globalMediaCondition = settings.mobileFirst ? 'min-width' : 'max-width';

let str = '';
let str = '@use "sass:math";\n';

str += "{{var}}columns{{=}}" + resources.settings.columns + '{{;}}\n';
str += "{{var}}atom{{=}}(100% / {{var}}columns){{;}}\n";
str += "{{var}}atom{{=}}math.div(100% , {{var}}columns){{;}}\n";

str += '\n';

Expand Down Expand Up @@ -45,10 +45,10 @@ function Build(settings, patterns) {

str += '\n';

str += "{{var}}offset_one_side{{=}}({{var}}offset / 2){{;}}\n";
str += "{{var}}offset_one_side{{=}}math.div({{var}}offset , 2){{;}}\n";

for (let name in resources.settings.breakPoints) {
str += `{{var}}offset_${name}_one_side{{=}}({{var}}offset_${name} / 2){{;}}\n`;
str += `{{var}}offset_${name}_one_side{{=}}math.div({{var}}offset_${name} , 2){{;}}\n`;
}

str += '\n';
Expand Down Expand Up @@ -118,8 +118,8 @@ function Build(settings, patterns) {
let uRowCommands = resources.styles.objToStyles({
display: 'flex',
'flex-wrap': 'wrap',
'margin-left': '({{var}}offset / -2)',
'margin-right': '({{var}}offset / -2)'
'margin-left': 'math.div({{var}}offset , -2)',
'margin-right': 'math.div({{var}}offset , -2)'
}, 1);

let urow = new resources.mixin(resources.patterns.mixin,
Expand All @@ -133,8 +133,8 @@ function Build(settings, patterns) {
let uColCommands = resources.styles.objToStyles({
'box-sizing': 'border-box',
'word-wrap': 'break-word',
'margin-left': '({{var}}offset / 2)',
'margin-right': '({{var}}offset / 2)'
'margin-left': 'math.div({{var}}offset , 2)',
'margin-right': 'math.div({{var}}offset , 2)'
}, 1);

let ucol = new resources.mixin(resources.patterns.mixin,
Expand Down
2 changes: 1 addition & 1 deletion system/shift.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class Shift{
}
}
else{
styles += `{{var}}val{{=}}100% / {{var}}columns * {{var}}n{{;}}\n`;
styles += `{{var}}val{{=}}calc( 100% / {{var}}columns * {{var}}n){{;}}\n`;

for(let j = 0; j < this.map[i].props.length; j++){
if(j > 0){
Expand Down
2 changes: 1 addition & 1 deletion system/size.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Size{
});
}
else{
style += `{{var}}val{{=}}100% / {{var}}columns * {{var}}n{{;}}\n`;
style += `{{var}}val{{=}}calc(100% / {{var}}columns * {{var}}n){{;}}\n`;

style += this.resources.styles.objToCallMedia(this.postfix, {
width: `{{i}}calc({{string-var}}val{{/string-var}} - {{string-var}}offset${mediaPostfix}{{/string-var}}){{/i}}`
Expand Down

0 comments on commit 282c890

Please sign in to comment.