Optimizating (!important solution)#66
Open
dkconnect wants to merge 4 commits into
Open
Conversation
The core optimization strategy for this code was centered on creating a design system using CSS Custom Variables. I introduced a new :root block to centralize all repeating values like colors, common spacing units, and key font sizes, because hardcoding these values makes future design changes or updates tedious and messy. This aso allowed for a cleanup by removing excessive use of the !important flag within the mobile media queries.\ I did this because !important creates a specificity war, making the code fragile and difficult to override later.
Owner
|
Thanks for your PR! I will review soon. Currently swamped with college applications. |
Owner
|
Thanks for the PR! I like the idea of cleaning up the CSS with variables. Before I can merge this though, there are a few undefined CSS variables being used that aren't declared in the :root block:
Some of these have fallback values (like var(--color-light-text, #ccc)) so they won't visually break, but others like margin-bottom: var(--spacing-md) have no fallback and will be Could you add the missing variable definitions to :root and I'll merge it? |
Hi @codergautam Thanks for reviewing my earlier PR! I’ve added all the previously missing CSS variables to the :root block, including: --spacing-md --spacing-sm --radius-sm --color-light-text --color-dark-text
Author
|
Hey @codergautam please have a look |
Owner
|
Looking soon |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I just tried doing this, loved this project and would love to contribute to improve it further.
The core optimization strategy for this code was centered on creating a design system using CSS Custom Variables. I introduced a new
:rootblock to centralize all repeating values like colors, common spacing units, and key font sizes, because hardcoding these values makes future design changes or updates tedious and messy.This also allowed for a cleanup by removing excessive use of the
!importantflag within the mobile media queries. I did this because!importantcreates a "specificity war," making the code fragile and difficult to override later.