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
Fixed scss function arguments on different lines in maps #9128 #9184
Changes from 9 commits
e8d88ea
dea1878
9e2dbfd
f19e2dc
f04f623
4b842ad
9a666b2
2e76a1a
56e605f
4db2fae
a3b690b
270325b
97449b6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`functional_argument_on_same_lines_in_maps.scss format 1`] = ` | ||
====================================options===================================== | ||
parsers: ["scss"] | ||
printWidth: 80 | ||
| printWidth | ||
=====================================input====================================== | ||
//simple test | ||
$display-breakpoints: map-deep-merge( | ||
( | ||
"print-only": "only print", | ||
"screen-only": "only screen", | ||
"xs-only": "only screen and (max-width: #{map-get($grid-breakpoints, "sm") - 1})", | ||
"sm-only": "only screen and (min-width: #{map-get($grid-breakpoints, "sm")}) and (max-width: #{map-get($grid-breakpoints, "md") - 1})", | ||
), | ||
$display-breakpoints | ||
); | ||
|
||
|
||
//list test | ||
@each | ||
$size | ||
in | ||
$sizes { | ||
.icon | ||
#{$size} | ||
{ | ||
border | ||
: | ||
"#{$size + "px"}" | ||
solid | ||
red; | ||
} | ||
} | ||
|
||
@each | ||
$size | ||
in | ||
$sizes { | ||
.icon-#{$size} | ||
{ | ||
border | ||
: | ||
"#{$size + "px"}" | ||
solid | ||
red; | ||
} | ||
} | ||
|
||
//map test | ||
$font-weights | ||
: | ||
("regular": 400 | ||
, | ||
"medium": 500, | ||
"bold": | ||
700); | ||
@each | ||
$name, | ||
$boldness | ||
in | ||
$icons { | ||
.text | ||
#{ | ||
$name | ||
} { | ||
color: red; | ||
font-weight: | ||
"#{$boldness}" | ||
} | ||
} | ||
|
||
$font-weights | ||
: | ||
("regular": 400 | ||
, | ||
"medium": 500, | ||
"bold": | ||
700); | ||
@each | ||
$name, | ||
$boldness | ||
in | ||
$icons { | ||
.text-#{ | ||
$name | ||
} { | ||
color: red; | ||
font-weight: | ||
"#{$boldness}" | ||
} | ||
} | ||
=====================================output===================================== | ||
//simple test | ||
$display-breakpoints: map-deep-merge( | ||
( | ||
"print-only": "only print", | ||
"screen-only": "only screen", | ||
"xs-only": "only screen and (max-width: #{map-get($grid-breakpoints, "sm") - 1})", | ||
"sm-only": "only screen and (min-width: #{map-get($grid-breakpoints, "sm")}) and (max-width: #{map-get($grid-breakpoints, "md") - 1})", | ||
), | ||
$display-breakpoints | ||
); | ||
|
||
//list test | ||
@each $size in $sizes { | ||
.icon #{$size} { | ||
border: "#{$size + "px"}" solid red; | ||
} | ||
} | ||
|
||
@each $size in $sizes { | ||
.icon-#{$size} { | ||
border: "#{$size + "px"}" solid red; | ||
} | ||
} | ||
|
||
//map test | ||
$font-weights: ( | ||
"regular": 400, | ||
"medium": 500, | ||
"bold": 700, | ||
); | ||
@each $name, $boldness in $icons { | ||
.text #{ $name } { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @fisker and should not, you can write it in different ways (all valid):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean space inside There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, you are right /cc @agamkrbit There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I well make the changes .. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like we are keeping spaces on stable version. Prettier 2.1.2 --parser scss Input: #{$a } {
color: red;
}
#{ $a} {
color: red;
}
#{ $a } {
color: red;
}
#{$a} {
color: red;
} Output: #{$a } {
color: red;
}
#{ $a} {
color: red;
}
#{ $a } {
color: red;
}
#{$a} {
color: red;
}
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah. |
||
color: red; | ||
font-weight: "#{$boldness}"; | ||
} | ||
} | ||
|
||
$font-weights: ( | ||
"regular": 400, | ||
"medium": 500, | ||
"bold": 700, | ||
); | ||
@each $name, $boldness in $icons { | ||
.text-#{ $name } { | ||
color: red; | ||
font-weight: "#{$boldness}"; | ||
} | ||
} | ||
|
||
================================================================================ | ||
`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
//simple test | ||
$display-breakpoints: map-deep-merge( | ||
( | ||
"print-only": "only print", | ||
"screen-only": "only screen", | ||
"xs-only": "only screen and (max-width: #{map-get($grid-breakpoints, "sm") - 1})", | ||
"sm-only": "only screen and (min-width: #{map-get($grid-breakpoints, "sm")}) and (max-width: #{map-get($grid-breakpoints, "md") - 1})", | ||
), | ||
$display-breakpoints | ||
); | ||
|
||
|
||
//list test | ||
@each | ||
$size | ||
in | ||
$sizes { | ||
.icon | ||
#{$size} | ||
{ | ||
border | ||
: | ||
"#{$size + "px"}" | ||
solid | ||
red; | ||
} | ||
} | ||
|
||
@each | ||
$size | ||
in | ||
$sizes { | ||
.icon-#{$size} | ||
{ | ||
border | ||
: | ||
"#{$size + "px"}" | ||
solid | ||
red; | ||
} | ||
} | ||
|
||
//map test | ||
$font-weights | ||
: | ||
("regular": 400 | ||
, | ||
"medium": 500, | ||
"bold": | ||
700); | ||
@each | ||
$name, | ||
$boldness | ||
in | ||
$icons { | ||
.text | ||
#{ | ||
$name | ||
} { | ||
color: red; | ||
font-weight: | ||
"#{$boldness}" | ||
} | ||
} | ||
|
||
$font-weights | ||
: | ||
("regular": 400 | ||
, | ||
"medium": 500, | ||
"bold": | ||
700); | ||
@each | ||
$name, | ||
$boldness | ||
in | ||
$icons { | ||
.text-#{ | ||
$name | ||
} { | ||
color: red; | ||
font-weight: | ||
"#{$boldness}" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
run_spec(__dirname, ["scss"]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure it is safe to trim here, why we do it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stringify was adding extra '\n', so I am using trim