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

luci-theme-boostrap: cascade.css: Refactor unnecessary calc() #7318

Conversation

griffenedge
Copy link
Contributor

hsl lightness values are being unnecessarily calculated using calc(n / 255 * 100%). This PR replaces all instances of calc(n / 255 * 100%) with their calculated percentage values to 2 decimal points (e.g. calc(6 / 255 * 100%) -> 2.35%).

"You don’t need to use calc() to do math on numbers that you could do the math for." - https://jdsteinbach.com/css/where-to-use-css-calc-real-world/#for-math-on-compatible-numbers

  • This PR is not from my main or master branch 💩, but a separate branch ✅
  • Each commit has a valid ✒️ Signed-off-by: <[email protected]> row (via git commit --signoff)
  • Each commit and PR title has a valid 📝 <package name>: title first line subject for packages
  • Incremented 🆙 any PKG_VERSION in the Makefile
  • Tested on: (architecture, openwrt version, browser) ✅
  • ( Preferred ) Mention: @ the original code author for feedback
  • ( Preferred ) Screenshot or mp4 of changes:
  • Description: (describe the changes proposed in this PR)

@dannil
Copy link
Contributor

dannil commented Oct 9, 2024

Typo in commit message: luci-theme-boostrap -> luci-theme-bootstrap

Replace all calc() doing maths on compatible numbers with their final values (to 2 decimal points).

Signed-off-by: Griffen Edge <[email protected]>
@griffenedge griffenedge force-pushed the luci-theme-bootstrap/remove-unnecessary-calc branch from 7a652af to aba7f8a Compare October 9, 2024 06:31
@griffenedge
Copy link
Contributor Author

Typo in commit message: luci-theme-boostrap -> luci-theme-bootstrap

Fixed

@systemcrash systemcrash merged commit c68d5c8 into openwrt:master Oct 10, 2024
1 check passed
@systemcrash
Copy link
Contributor

Merged. Thanks @griffenedge

@griffenedge griffenedge deleted the luci-theme-bootstrap/remove-unnecessary-calc branch October 15, 2024 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants