3 ms·
It sounds like you're blaming CSS for the shortcomings of the library you're using. CSS cascades, embrace it rather than fighting it. Have a .btn rule that st
by petepete 2y ago
It sounds like you're blaming CSS for the shortcomings of the library you're using.
CSS cascades, embrace it rather than fighting it.
Have a .btn rule that styles all your buttons. Have a .warning one that makes it yellow. Then instead of `<button class="btn-warning">` use `<button class="btn warning">`.
Or just use Sass instead!
- lelanthran 2y ago> It sounds like you're blaming CSS for the shortcomings of the library you're using. ... > Or just use Sass instead! Maybe I was unclear: my gripe is that this functionality is such a necessary thing to have, that external non-spec third-party tools have to be used to get this functionality. It is a shortcoming of CSS, because CSS is not providing this functionality that users want. The fact that everyone is using a third party tool to get this functionality only reinforces my point: if everyone is doing it, then it's a shortcoming. > Have a .btn rule that styles all your buttons. Have a .warning one that makes it yellow. Then instead of `<button class="btn-warning">` use `<button class="btn warning">`. I do this, but it ends up being `class="<godawful number of named classes?"` and is prone to breakage when you need to update or modify a theme.
- xoac 2y agoSkill issue
- AndriyKunitsyn 2y agoRight. How different would it be from just writing inline CSS, exactly?
- codedokode 2y agoIt is better to use BEM naming, so the example becomes <button class="btn btn--warning"> Here double minus means that "warning" is a state of an element named "btn".