14
246
Fork
You've already forked pyfedi
75

Updated CSS font variables: pixel and percent based variables replaced with REM with pixel fallback #1835

Closed
travis-jeans wants to merge 0 commits from travis-jeans/pyfedi:text_vars into main
pull from: travis-jeans/pyfedi:text_vars
merge into: rimu:main
rimu:main
rimu:v1.7.x
rimu:v1.6.x
rimu:v1.5.x
rimu:v1.4.x
rimu:v1.2.x
rimu:v1.3.x
rimu:async-microservice
rimu:gevent
rimu:schema
rimu:v1.1.x
rimu:swagger-api
rimu:v1.0.x
rimu:v0.99
rimu:infinite-scroll
rimu:refactor-post-new
Contributor
Copy link

Some tweaks to the _typography (and other) SCSS files. All pixel font variables are removed and replaced with REM variables (or the closest equivalents). Some other minor things:

  • Added a variable for h5 in case someone wants to use it.
  • Percent-based variables are replaced with rem.

When turning the changes on and off in Stylus a few noticeable "overall" changes:

  • heading sizes and body fonts are slightly bigger
  • muted, and some side-panel fonts are smaller

In the SCSS files where font-size is updated it looks a bit like this:
font-size: 20px;
font-size: var(--font-size-20); // rem version

The idea is that if older browsers don't support rem sizing they will have the 20px defined as a fall-back. It is a little redundant, but hopefully improves the experience for those using alternate browsers that have variable support for CSS prior to the rem unit's release (<2013).

Overall, I don't think this makes too many drastic changes to how Pyfedi looks however it does a lot of cleaning up and organising behind the scenes in the SCSS files.

Some tweaks to the _typography (and other) SCSS files. All pixel font variables are removed and replaced with REM variables (or the closest equivalents). Some other minor things: - Added a variable for h5 in case someone wants to use it. - Percent-based variables are replaced with rem. When turning the changes on and off in Stylus a few noticeable "overall" changes: - heading sizes and body fonts are slightly bigger - muted, and some side-panel fonts are smaller In the SCSS files where font-size is updated it looks a bit like this: font-size: 20px; font-size: var(--font-size-20); // rem version The idea is that if older browsers don't support rem sizing they will have the 20px defined as a fall-back. It is a little redundant, but hopefully improves the experience for those using alternate browsers that have variable support for CSS prior to the rem unit's release (<2013). Overall, I don't think this makes too many drastic changes to how Pyfedi looks however it does a lot of cleaning up and organising behind the scenes in the SCSS files.
travis-jeans changed title from (削除) Updated the font variables so they are using pixel sizes with a fallback REM option. Percentage based font variables are removed and replaced with closest REM equivalents. (削除ここまで) to Updated CSS font variables: pixel and percent based variables replaced with REM with pixel fallback 2026年06月22日 09:00:13 +02:00
travis-jeans changed title from (削除) Updated the font variables so they are using pixel sizes with a fallback REM option. Percentage based font variables are removed and replaced with closest REM equivalents. (削除ここまで) to Updated CSS font variables: pixel and percent based variables replaced with REM with pixel fallback 2026年06月22日 09:00:13 +02:00
Owner
Copy link

Thanks for this!

Phew, that was a pretty rough merge, tho.

I think it was complex this time because this PR didn't build on your other PR's changes, it was starting from before the first PR. So after merging in the first PR the second one fought with it.

Thanks for this! Phew, that was a pretty rough merge, tho. I think it was complex this time because this PR didn't build on your other PR's changes, it was starting from before the first PR. So after merging in the first PR the second one fought with it.
rimu closed this pull request 2026年06月23日 11:21:40 +02:00
Owner
Copy link

If you'd like to see this in a site with live data in it, check out https://crust.piefed.social

If you'd like to see this in a site with live data in it, check out https://crust.piefed.social
Author
Contributor
Copy link

@rimu wrote in #1835 (comment):

Thanks for this!

Phew, that was a pretty rough merge, tho.

I think it was complex this time because this PR didn't build on your other PR's changes, it was starting from before the first PR. So after merging in the first PR the second one fought with it.

Yeah sorry about that, I thought it would be easier to review if I kept them separate. Thanks for accepting the changes though and handling the merge (happy to do it myself next time if you don't mind waiting an extra day).@rimu wrote in #1835 (comment):

f you'd like to see this in a site with live data in it, check out https://crust.piefed.social

This is really useful, thanks!

@rimu wrote in https://codeberg.org/rimu/pyfedi/pulls/1835#issuecomment-17931272: > Thanks for this! > > Phew, that was a pretty rough merge, tho. > > I think it was complex this time because this PR didn't build on your other PR's changes, it was starting from before the first PR. So after merging in the first PR the second one fought with it. Yeah sorry about that, I thought it would be easier to review if I kept them separate. Thanks for accepting the changes though and handling the merge (happy to do it myself next time if you don't mind waiting an extra day).@rimu wrote in https://codeberg.org/rimu/pyfedi/pulls/1835#issuecomment-17933999: > f you'd like to see this in a site with live data in it, check out https://crust.piefed.social This is really useful, thanks!
Author
Contributor
Copy link

Forgot to mention this is an update relating to #1594.

Forgot to mention this is an update relating to #1594.

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rimu/pyfedi!1835
Reference in a new issue
rimu/pyfedi
No description provided.
Delete branch "travis-jeans/pyfedi:text_vars"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?