Repository navigation
Closed
Labels
lang:css/scss/lessIssues affecting CSS, Less or SCSSlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.priority:highCode is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent!
Description
Prettier 1.10.2
Playground link
--parser scssInput:
@function getBp($key) {
@if map-has-key($grid_breakpoints, $key) {
@return map-get($grid_breakpoints, $key);
}
@warn "Unknown `#{$key}` in $grid_breakpoints.";
@return null;
}
@function getbp($key) {
@return getBp($key);
}
.card-column-simple {
@include breakpoint( getBp( md ) ) {
padding: $spacing_content-sm $spacing_content-md;
}
@include breakpoint (getBp(md)) {
&:nth-child(2n + 3) {
clear: both;
}
}
@include breakpoint (getBp(xl)) {
&:nth-child(2n + 3) {
clear: none;
}
&:nth-child(3n + 4) {
clear: both;
}
}
}
Output:
@function getBp($key) {
@if map-has-key($grid_breakpoints, $key) {
@return map-get($grid_breakpoints, $key);
}
@warn "Unknown `#{$key}` in $grid_breakpoints.";
@return null;
}
@function getbp($key) {
@return getBp($key);
}
.card-column-simple {
@include breakpoint( getBp( md ) ) {
padding: $spacing_content-sm $spacing_content-md;
}
@include breakpoint (getbp(md)) {
&:nth-child(2n + 3) {
clear: both;
}
}
@include breakpoint (getbp(xl)) {
&:nth-child(2n + 3) {
clear: none;
}
&:nth-child(3n + 4) {
clear: both;
}
}
}
Diff:
--- a/example.scss
+++ b/example.scss
@@ -11,20 +11,18 @@
@return getBp($key);
}
-
.card-column-simple {
-
@include breakpoint( getBp( md ) ) {
padding: $spacing_content-sm $spacing_content-md;
}
- @include breakpoint (getBp(md)) {
+ @include breakpoint (getbp(md)) {
&:nth-child(2n + 3) {
clear: both;
}
}
- @include breakpoint (getBp(xl)) {
+ @include breakpoint (getbp(xl)) {
&:nth-child(2n + 3) {
clear: none;
}Expected behavior:
The function calls being used as parameters get changed to lowercase... but not always. Based on everything I've read I would expect them to be left alone entirely.
Metadata
Metadata
Assignees
Labels
lang:css/scss/lessIssues affecting CSS, Less or SCSSlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.priority:highCode is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent!
Activity
lydell commentedon Jan 15, 2018
Yes, function names should be left alone entirely. Labeling as "high priority" since it breaks code.