iTwin / iTwinUI

A design system for building beautiful and well-working web interfaces.
https://itwin.github.io/iTwinUI/
MIT License
105 stars 38 forks source link

Reducing specificity of button selectors #225

Closed mayank99 closed 2 years ago

mayank99 commented 3 years ago

Currently, the long button selectors make it really hard to add custom styles.

Some requirements:

mayank99 commented 2 years ago

Found another related problem (https://github.com/iTwin/iTwinUI/pull/253#discussion_r699658717): Currently, it's very hard to override size/padding of any button. For example, a small borderless button has a specificity of 0-3-0 (.iui-button.iui-borderless.iui-small).

Unsure how this could be solved though. Maybe the user should not use small if they want to override styles. And then we could change the .iui-button.iui-borderless selector to just button.iui-borderless (0-1-1, easier to override). Edit: this was solved by adding the ability to set size through iui-button-size mixin rather than forcing class names.