Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the remaining dir-dependent CSS rules #14693

Merged
merged 1 commit into from
Mar 27, 2022

Conversation

Snuffleupagus
Copy link
Collaborator

After the recent round of patches, I figured that we'd gone as far as possible in replacing dir-dependent CSS rules for the viewer.
However, it occurred that me that we could actually use a bit of CSS-trickery to get rid of the remaining ones. More specifically, this was done by defining a CSS variable whose value depends on the document direction and then using that variable together with calc() in the affected rules.

Please note: I suppose that this could perhaps be seen as a bit too "magical", hence I understand if this patch is ultimately rejected, however this is probably the only simple way to get rid of the remaining dir-dependent CSS rules.

@calixteman
Copy link
Contributor

Magic exists to be used ;).

After the recent round of patches, I figured that we'd gone as far as possible in replacing `dir`-dependent CSS rules for the viewer.
However, it occurred that me that we could actually use a bit of CSS-trickery to get rid of the remaining ones. More specifically, this was done by defining a CSS variable whose value depends on the document direction and then using that variable together with `calc()` in the affected rules.

*Please note:* I suppose that this could perhaps be seen as a bit too "magical", hence I understand if this patch is ultimately rejected, however this is probably the only simple way to get rid of the remaining `dir`-dependent CSS rules.
@Snuffleupagus Snuffleupagus marked this pull request as ready for review March 23, 2022 21:07
@Snuffleupagus
Copy link
Collaborator Author

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_preview from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/5097205ee3230ae/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/5097205ee3230ae/output.txt

Total script time: 2.53 mins

Published

@timvandermeij timvandermeij merged commit d4714b3 into mozilla:master Mar 27, 2022
@timvandermeij
Copy link
Contributor

Thanks!

@Snuffleupagus Snuffleupagus deleted the CSS-dir-factor branch March 27, 2022 12:14
@Snuffleupagus
Copy link
Collaborator Author

@timvandermeij Thanks for reviewing/merging all of the recent CSS patches!

For reference: After the recent round of CSS clean-up, for the gulp mozcentral target the size of the built viewer.css file has been reduced by > 8 % thanks to using logical properties.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants