chore(css): Add grunttask to fix content-server Tailwind selectors #16466
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Because:
This commit:
fixes FXA-9167, fixes FXA-9170
In #16445, I wondered if removing
--minify
would not fix the problem (see the "EDIT" and comments). We included the fix in a dot release and I've since confirmed a few things:--minify
does not do anything for us for content-server at least, I compared what was uploaded to stage before and after this option and there is no diff because...ltr
andrtl
classes did not produce:where([dir="ltr"], [dir="ltr"] *)
selectors. It's possible this selector output (specifically the asterisk) is a bug in Tailwind but I'd need to do more investigating.I tried every available formatting option for the
cssmin
task and also tried tweaking the level to prevent needing a new task, and nothing addressed this problem. I also tried excluding the Tailwind file from thecssmin
task but couldn't get this to work.I started adjusting the classes themselves to not use these selectors, but we've got a few that we'd have to change to something like
[dir='rtl'] & {
, and then we'd have to know and abide by not use these Tailwind classes in content-server due to the minify problem.This seemed like a reasonable solution for now since we hope to sunset content-server soon anyway. Other options were described above, or downgrading Tailwind and pinning us to a version until we've sunsetted content-server or until/unless they tweak the selector.
This fix can be verified by running
yarn build
before and after this change in content-server and checking thedist/styles/[hash].tailwind.out.css
file. See that before, there are several]*
references and after, they've become] *
.