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

Document Component Class Mixing #5413

Open
jmuzina opened this issue Nov 22, 2024 · 1 comment
Open

Document Component Class Mixing #5413

jmuzina opened this issue Nov 22, 2024 · 1 comment
Labels
Documentation 📝 Documentation changes or updates Triaged: v4 Triaged, to be implemented as part of Vanilla v4

Comments

@jmuzina
Copy link
Member

jmuzina commented Nov 22, 2024

Vanilla has an unspoken style rule that component class names should not be mixed (i.e., an element should only have classes from one component, and possibly is-<theme> modifier).

For example (adapted from thread by @petesfrench ):

<!-- Unofficial "recommended" usage -->
<div class="row--50-50">
  <div class="col">
    <div class="p-section">
      <p>Text</p>
    </div>
  </div>
</div>

<!-- This happens quite a bit in sites -->
<div class="row--50-50">
  <div class="col p-section">
      <p>Text</p>
  </div>
</div>

<!-- This can also happen -->
<div class="row--50-50">
  <div class="col">
      <p class="p-section">But this also works</p>
  </div>
</div>

This introduces inconsistency between projects and could lead to broken styling. We should document this (perhaps at the site-wide level) and inform users about the recommended usage more officially, so that this convention can be more formalized.

@jmuzina jmuzina added the Documentation 📝 Documentation changes or updates label Nov 22, 2024
Copy link

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/WD-17170.

This message was autogenerated

@bartaz bartaz added the Triaged: v4 Triaged, to be implemented as part of Vanilla v4 label Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation 📝 Documentation changes or updates Triaged: v4 Triaged, to be implemented as part of Vanilla v4
Projects
None yet
Development

No branches or pull requests

2 participants