Skip to content

Conversation

@basham
Copy link
Member

@basham basham commented Sep 25, 2025

Change:

  1. Add custom elements: <rvt-button>, <rvt-button-group>, <rvt-badge>
  2. Add custom attribute: rvt-margin (medium spacing only so far)

Note:

  1. This work is not meant to be comprehensive but rather as a discussion point. I want to also use it to illustrate our explorations for the upcoming Dev CoP meeting.
  2. If this is not the direction we go, we can also remove it before 3.0.0 is officially released.
  3. If we generally think this is worthy of continuing, I can try to make custom element equivalents for all the components we're working on, in parallel with the traditional BEM convention.
  4. Best practice is to isolate all custom attributes under data-, but data-rvt-margin seems excessively long. I think our rvt- namespace is sufficient.
  5. Custom attributes on custom elements do not need a namespace, as the element is already namespaced.
  6. Because "style" is a reserved attribute name, I categorized strong/normal/subtle as "tone". In terms of "voice and tone" usage: Voice is what is said (the text content). Tone is how it is said (the visual/auditory expression and emphasis).
  7. I was unsure about how I'd like nesting <button> in a <rvt-button> — but I like the style. It promotes composition over inheritance and isolates concerns.
  8. Migrating away from BEM-style modifier classes to attributes will make make it easier to document exactly what each custom element offers. "'Medium' is a 'size' option. 'Strong' is a 'tone' option."
  9. See article: This website has no class
  10. See article: CSS Classes considered harmful

@basham basham changed the title Make rvt-button, rvt-button-group, rvt-margin Add rvt-button, rvt-button-group, rvt-margin Sep 25, 2025
@basham basham marked this pull request as ready for review September 25, 2025 16:25
@basham basham requested a review from levimcg September 25, 2025 16:26
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

Successfully merging this pull request may close these issues.

2 participants