MaastrichtU-BISS / lawnotation

Legal text annotation platform for researchers, legal practioners and more!
https://app.lawnotation.org
Apache License 2.0
5 stars 0 forks source link

Tailwind css priority issue #10

Open eensander opened 1 year ago

eensander commented 1 year ago

Sometimes it is desired to define base/default styles with a lower priority than the tailwindcss utility and base classes. Use-cases for this is having default styles for frequently used elements, such as inputs, textareas, buttons, etc. The problem arises when small deviations from these base definitions need to be applied to specific instances of elements. Since the priority of the custom-defined base-classes is higher than those of tailwind, it is difficult to change these styles.

I was unable to implement the suggestions given in this discussion.

eensander commented 1 year ago

As a solution/workaround it is chosen to add the simple class base to all base styles. All elements to which the base styles should be applied, should implement this class. All of the elements to which this style applies are defined in the file style/minimal.scss. If changes to base styles are desired, this is the file to modify.

Note that this does not solve the root problem: when a base style is desired for an element, but one deviation from an already used style from this base style is required, it is not possible to override this specific style using tailwind utility classes. Though, it is possible to override it using the html style-attribute. Alternatively, all of the styles from the desired base-class should be copied onto the class-attribute.

eensander commented 1 year ago

Class base added to style definitions in minimal.scss and to relevant elements in commit e7f6ac18