Skip to content

Lightning 1.21 generates invalid CSS for Webkit pseudo-selectors #536

@bakura10

Description

@bakura10

Hi !

Starting from Lightning 1.21, the following code:

.quantity-selector__input {
  appearance: textfield;

  &::-webkit-outer-spin-button,
  &::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }
}

Generate as:

.quantity-selector__input {
  appearance: textfield;
}

:is(.quantity-selector__input::-webkit-outer-spin-button, .quantity-selector__input::-webkit-inner-spin-button) {
  -webkit-appearance: none;
  margin: 0;
}

Unfortunately the :is generates invalid code as the Webkit pseudo selectors do not work. Lightning 1.20 and lower generates the correct CSS (I am actually unsure as to why Lightning generates this as the first place, as this actually makes the code longer than what it has to be):

.quantity-selector__input {
  appearance: textfield;
}

.quantity-selector__input::-webkit-outer-spin-button, .quantity-selector__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

This is probably related to this: #352

If this is not a valid selector, then Lightning should generate something in the console, as this is a breaking change compared to the 1.20 and lower behavior :). This can caught by surprise everyone who upgrade to 1.21.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions