-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Refactor style.css #1786
base: gh-pages
Are you sure you want to change the base?
Refactor style.css #1786
Conversation
✅ Deploy Preview for expressjscom-preview ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
3a3a78e
to
12cb8b8
Compare
What maintainability issues are you running into currently? That the styles file is 1200 lines long? I see the value in organizing styles, but right now, this approach increases the number of HTTP requests without a build step to merge them (jekyll supports scss), which could negatively impact performance. We go from 1 request to 9. Also, from a developer experience perspective, having to jump between multiple small files can sometimes make it harder to track down and modify styles efficiently. A single, well-structured file can often be easier to work with than several separate ones. Some of these files, like The goal should be improving maintainability without making performance worse or adding manual overhead. What do you think? |
It's a very large and somewhat disorganized file, so if we can separate it into a few files and organize it better, that would be great.
I like both options, I will apply them. Thanks for the suggestion! |
Please don't add files in header that are not present in repo. express.com showing same error in the console.
Are you planning to add light-theme? I dont think it is needed. As @jonchurch said don't increase network calls. Just need to remove redundant css selectors. I can see that light mode text colors and background colors are not broken in this pr but I dont find light-theme.css file in pr. |
I forgot to remove that request from the head, sorry about that. I've deleted it in this pr. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Api
add Basic accessibility like key :focus and :hover styles.
We still need to style responsive #menu bar on api/blog pages. Will be is done in pr #1775.
Blogs
Make changes in comment and moving blog side bar css code into blog.css file. This side bar also need changes in :focus, :hover selectors, responsive layout changes.
#menu { | ||
position: fixed; | ||
margin: 0; | ||
padding: 0 10px 0 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | ||
|
||
#menu a { | ||
color: var(--menu-grey); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
color: var(--menu-grey); | |
color: var(--menu-grey); | |
display: block; | |
padding-block: 0.2rem; | |
padding-inline: 0.2rem; | |
margin-inline: 0.2rem; | |
border-radius: 0.2rem; | |
&:hover { | |
color: var(--fg); | |
} | |
&:focus { | |
outline: 1px solid var(--fg); | |
} |
increase clicking area for all links
We need both selectors, and :focus to show same focus state across all browsers.
font-size: 13px; | ||
} | ||
|
||
#menu ul a { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#menu ul a { |
#menu ul a {} is redundant selector remove it
} | ||
|
||
#menu ul a { | ||
padding-right: 7px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
padding-right: 7px; |
|
||
#menu ul a { | ||
padding-right: 7px; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} |
} | ||
} | ||
|
||
/* -------- Submenu --------*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/* -------- Submenu --------*/ | |
/* -------- navigation Submenu --------*/ |
} | ||
} | ||
|
||
/* ----------------- Blog --------------------- */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/* ----------------- Blog --------------------- */ | |
/* ----------------- Blog side bar --------------------- */ |
Can we put this in blog.css? I was thinking of using same blog side bar on guide page, security best practices and performance best practices pages.
} | ||
} | ||
|
||
/* ----------------- Side Menu --------------------- */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/* ----------------- Side Menu --------------------- */ | |
/* ----------------- api Side Menu --------------------- */ |
I'm trying not to delete or modify any CSS styles, as these are style changes of code. |
To make it more maintainable and to better edit our styles, I am separating the styles into multiple files depending on their purpose.