chromaui / storybook-addon-pseudo-states

CSS pseudo-classes for Storybook
MIT License
88 stars 28 forks source link

Media queries mess up stylesheet override #57

Closed filipw01 closed 1 year ago

filipw01 commented 1 year ago

Version v2.0.0-next.0

Because index is not incremented here, media queries just go to the next rule. This leads to a situation where

@media only screen and (max-width: 790px) {
    .test {
        background-color: green;
    }
}

.test {
    background-color: blue;
}

.test:hover {
    background-color: red;
}

.test2:hover {
    background-color: white;
}

is rewritten to

@media only screen and (max-width: 790px) {
    .test {
        background-color: green;
    }
}

.test:hover, .pseudo-hover.test, .pseudo-hover .test {
    background-color: red;
}

.test2:hover, .pseudo-hover.test2, .pseudo-hover .test2 {
    background-color: white;
}

.test2:hover {
    background-color: white;
}

I will open a PR fixing soon

github-actions[bot] commented 1 year ago

:rocket: Issue was released in v2.0.0 :rocket: