Skip to content

Instantly share code, notes, and snippets.

@ChristianKienle
Created February 26, 2019 15:44
Show Gist options
  • Save ChristianKienle/93d18c939010a31db07be940d66bd728 to your computer and use it in GitHub Desktop.
Save ChristianKienle/93d18c939010a31db07be940d66bd728 to your computer and use it in GitHub Desktop.

Redundancy when using button groups

Let's say you want to mark a group of buttons as compactable. Instead of simpyl writing:

<div class="fd-button-group fd-is-compactable" role="group" aria-label="Group label">
  <button class="fd-button" aria-pressed="true">Left</button>
  <button class="fd-button">Middle</button>
  <button class="fd-button">Right</button>
</div>

one has to write:

<div class="fd-button-group" role="group" aria-label="Group label">
  <button class="fd-button fd-button--compact" aria-pressed="true">Left</button>
  <button class="fd-button fd-button--compact">Middle</button>
  <button class="fd-button fd-button--compact">Right</button>
</div>

Again: This is possible but leads to dirty code in the case of Vue.

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