You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nested media queries have wrong indentation on first arg
Media query arguments should have tab_size * (depth + 1) indentation,
but a nested media query incorrectly indents it's first arg to be tab_size * ((depth * 2) + 1).
Input
/* Works fine on depth 0 */
@media only screen and (min-width: 480px) {
#box {
background-color: green;
}
}
/* But not on nested media queries */
@supports (display: grid) {
@media only screen and (min-width : 480px) {
@media (color) and (min-height: 480px) and (max-height : 767px) {
#box {
background-color: red;
}
}
@media (color) and (min-height: 768px) and (max-height: 991px) {
#box {
background-color: blue;
}
}
}
}
My .csscleanrc file:
{
"tab_size": 4,
"tab_char": "space"
}
Actual Output
/* Works fine on depth 0 */
@media
only screen
and (min-width : 480px) {
#box {
background-color : green;
}
}
/* But not on nested media queries */
@supports (display: grid) {
@media
only screen
and (min-width : 480px) {
@media
(color)
and (min-height : 480px)
and (max-height : 767px) {
#box {
background-color : red;
}
}
@media
(color)
and (min-height : 768px)
and (max-height : 991px) {
#box {
background-color : blue;
}
}
}
}
Expected Output
/* Works fine on depth 0 */
@media
only screen
and (min-width : 480px) {
#box {
background-color : green;
}
}
/* But not on nested media queries */
@supports (display: grid) {
@media
only screen
and (min-width : 480px) {
@media
(color)
and (min-height : 480px)
and (max-height : 767px) {
#box {
background-color : red;
}
}
@media
(color)
and (min-height : 768px)
and (max-height : 991px) {
#box {
background-color : blue;
}
}
}
}
The text was updated successfully, but these errors were encountered:
After looking at the readme, it seems like the intention is that all arguments should be aligned with the first argument, not indented based on tab size.
However, it seems like the intention of src/main/getValue/modules/mediaQuery.js is to indent all arguments based on tab size. Did you change your intention for the project, but not update the readme?
Nested media queries have wrong indentation on first arg
Media query arguments should have
tab_size * (depth + 1)
indentation,but a nested media query incorrectly indents it's first arg to be
tab_size * ((depth * 2) + 1)
.Input
My .csscleanrc file:
Actual Output
Expected Output
The text was updated successfully, but these errors were encountered: