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

Replace dir-dependent padding-left/padding-right/text-align with logical properties #14669

Merged
merged 1 commit into from
Mar 13, 2022

Conversation

Snuffleupagus
Copy link
Collaborator

Please note: This is small first step in what will, time permitting, become a series of patches to simplify/modernize the viewer CSS.

Rather than having to manually specify ltr/rtl-specific padding-values in the CSS, we can use logical padding instead (and similar for text-align).
These logical properties depend on, among other things, the direction of the HTML document which we always specify in the viewer.

Note that a number of logical CSS properties are new enough that we'll need to use PostCSS plugins, however the ones in this patch are natively supported in all browsers that we currently support:

…ith logical properties

*Please note:* This is small first step in what will, time permitting, become a series of patches to simplify/modernize the viewer CSS.

Rather than having to *manually* specify ltr/rtl-specific padding-values in the CSS, we can use logical padding instead (and similar for text-align).
These logical properties depend on, among other things, the direction of the HTML document which we *always* specify in the viewer.

Note that a number of logical CSS properties are new enough that we'll need to use PostCSS plugins, however the ones in this patch are natively supported in all browsers that we currently support:
 - https://developer.mozilla.org/en-US/docs/Web/CSS/padding-inline-start#browser_compatibility
 - https://developer.mozilla.org/en-US/docs/Web/CSS/padding-inline-end#browser_compatibility
 - https://developer.mozilla.org/en-US/docs/Web/CSS/text-align#browser_compatibility
@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/90eb6ecce210b5b/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/90eb6ecce210b5b/output.txt

Total script time: 2.51 mins

Published

@timvandermeij timvandermeij merged commit 90c5e98 into mozilla:master Mar 13, 2022
@timvandermeij
Copy link
Contributor

I didn't know about those CSS properties yet, but this is very useful to avoid duplication. Thank you for doing this!

@Snuffleupagus Snuffleupagus deleted the padding-inline branch March 13, 2022 20:28
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

3 participants