Add script to compare Tailwind equivalents
What does this MR do and why?
How does the script work
- Adds all the Tailwind CSS equivalents to
config/helpers/tailwind/all_utilities.haml
so they will be generated by Tailwind CSS - Loops through the legacy CSS utils in
scripts/frontend/tailwind_equivalents.json
and compares the CSS properties to the Tailwind CSS equivalent - If there is a mismatch it outputs it to the console
- If the mismatch is not an issue (such as
border-top: 0
vsborder-top-width: 0
) then you can add it to themismatchAllowList
object and it will be skipped.
This script will also be helpful for continuing to build tailwind.config.js
. When we add to the config we can update the corresponding legacy CSS utils without a Tailwind equivalent (set to null
) and then run the script to verify they match.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
- Update a util in
scripts/frontend/tailwind_equivalents.json
to a Tailwind equivalent that is not configured or is a mistake (typo) - Run
node ./scripts/frontend/compare_tailwind_equivalents.mjs
Edited by Peter Hegman