Skip to content
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

Selectors with a class after the pseudo-element #829

Open
bin1357 opened this issue Oct 9, 2024 · 1 comment
Open

Selectors with a class after the pseudo-element #829

bin1357 opened this issue Oct 9, 2024 · 1 comment

Comments

@bin1357
Copy link

bin1357 commented Oct 9, 2024

Inconsistent behavior in the parser and strigifier when working with selectors with a class after the pseudo-element.

Expected behavior

Any output should be accepted as an input without errors

No error case

Input

.input::placeholder {
  &:not(.noAdaptiveTypography) {
    display: inline
  }
}

Output (get error case)

.input::placeholder:not(.noAdaptiveTypography) {
  display: inline;
}

Lightning CSS Playground

Error case

Input

.input::placeholder:not(.noAdaptiveTypography) {
  display: inline;
}

Output (get error case)

/* ERROR: Pseudo-elements like '::before' or '::after' can't be followed by selectors like 'Delim('.')' */

Lightning CSS Playground

@niksy
Copy link

niksy commented Dec 22, 2024

Getting the similar issue if you accidentaly target some element like br after pseudo element, e.g.:

.selector::after br {}

This isn’t valid of course, but maybe Lightning CSS can be forgiving in these cases?

Edit: just saw similar issue with suggestions on how to approach this, so ignore my comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@niksy @bin1357 and others