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

CSS naming conventions #6

Open
afercia opened this issue Apr 10, 2017 · 1 comment
Open

CSS naming conventions #6

afercia opened this issue Apr 10, 2017 · 1 comment

Comments

@afercia
Copy link
Contributor

afercia commented Apr 10, 2017

As discussed on Slack, see https://wordpress.slack.com/archives/C02RQBWTW/p1491840082372116 we should try to establish good CSS naming conventions. Also worth considering the CSS classes used for the fields can be re-used in other contexts, for example in the future Fields API and in any other part of the admin.

Some points emerged during the discussion:

  • the general issues is trying to establish easy and maintainable patterns, taking into considerations the CSS Roadmap https://make.wordpress.org/core/2014/12/19/core-css-roadmap/.
  • keep selectors specificity as low as possible, avoid overqualified selectors
  • Helen Hou-Sandí suggested selectors should also provide a context:
    • "In an ideal world, you would have some baseline stuff for elements themselves, and then you scope upward to apply specific stuff based on context as needed".
    • "The goal should be for people (devs) to not have to do anything involving class names or CSS the vast majority of the time."
  • Helen Hou-Sandí will try to start a doc to dump thoughts on the best option we have for CSS naming
  • CSS classes to target stuff in JS: they should be separate from classes used for styling
  • CSS classes for state naming for JS (e.g. .is-active or .is-dismissible)
@helen
Copy link

helen commented Apr 13, 2017

Thoughts, short of actual naming :) https://docs.google.com/document/d/1VWfm2fFMkgDi-SP8RzTXYXU9EdpPp8uQEtzCQBvYQFk/edit?usp=sharing

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

2 participants