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

Enhancemenet: add :defined pseudo class, fix #4080 #4081

Merged
merged 1 commit into from Jun 1, 2019

Conversation

lkraav
Copy link
Contributor

@lkraav lkraav commented May 14, 2019

Best practice for eliminating FOUC when using custom elements 1

app-drawer:not(:defined) {
  /* Pre-style, give layout, replicate app-drawer's eventual styles, etc. */
  display: inline-block;
  height: 100vh;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

Which issue, if any, is this issue related to?

Closes #4080

Is there anything in the PR that needs further explanation?

No, it's self explanatory.

@hudochenkov
Copy link
Member

Best practice for eliminating FOUC when using custom elements [1]

```css
app-drawer:not(:defined) {
  /* Pre-style, give layout, replicate app-drawer's eventual styles, etc. */
  display: inline-block;
  height: 100vh;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}
```

[1]: https://developers.google.com/web/fundamentals/web-components/customelements#prestyle
@lkraav
Copy link
Contributor Author

lkraav commented May 31, 2019

Not a 100% sure of what I was doing here, but maybe good enough?

PS it seemed like quite many pseudo elements are missing tests? has etc?

@hudochenkov
Copy link
Member

Looks like you need to run npm run prettier:fix.

Copy link
Member

@hudochenkov hudochenkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@hudochenkov hudochenkov merged commit cf8eff0 into stylelint:master Jun 1, 2019
@hudochenkov
Copy link
Member

Changelog:

  • Fixed: selector-pseudo-class-no-unknown false positives for defined (#4081).

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

Successfully merging this pull request may close these issues.

selector-pseudo-class-no-unknown: support :defined
4 participants