Remove overly specific css from main.css in site_template #1574

Merged
merged 1 commit into from Sep 23, 2013

Projects

None yet

3 participants

@edwardball
Contributor

I noticed the main.css file includes some overly specific CSS selectors. For example, since the whole page is wrapped in a div with a class of site there is no need to prefix any of the selectors .site (apart from the .site selector itself). And in general, there is very rarely a compelling reason to qualify a selector with a tag name i.e. it's better to write .posts instead of ul.posts.

More info about CSS efficiency can be found over at CSS Wizardry: http://csswizardry.com/2012/07/quasi-qualified-css-selectors/

@mattr-
Member
mattr- commented Sep 23, 2013

A comparison screenshot that shows no change to the rendering of the
site template would be nice to have. Would you mind doing that for us?

On Mon, Sep 23, 2013 at 7:46 AM, Aptary notifications@github.com wrote:

I noticed the main.css file includes some overly specific CSS selectors. For
example, since the whole page is wrapped in a div with a class of site there
is no need to prefix any of the selectors .site (apart from the .site
selector itself). And in general, there is very rarely a compelling reason
to qualify a selector with a tag name i.e. it's better to write .posts
instead of ul.posts.

More info about CSS efficiency can be found over at CSS Wizardry:
http://csswizardry.com/2012/07/quasi-qualified-css-selectors/


You can merge this Pull Request by running

git pull https://github.com/Aptary/jekyll simplified_css

Or view, comment on, or merge it at:

#1574

Commit Summary

Remove overly specific css from site template

File Changes

M lib/site_template/css/main.css (30)

Patch Links:

https://github.com/mojombo/jekyll/pull/1574.patch
https://github.com/mojombo/jekyll/pull/1574.diff

@edwardball
Contributor

Certainly, not a problem. Here's the home page and post page rendered with the old CSS. I've overlaid a 50% transparent screenshot on top of each with the new CSS, and as you can see, in both cases, old and new are absolutely identical :)

jekyll-home-comparison
jekyll-post-comparison

@mattr-
Member
mattr- commented Sep 23, 2013

Thanks! ❤️ You rock! 🤘

@mattr- mattr- merged commit d3cddc7 into jekyll:master Sep 23, 2013

1 check passed

default The Travis CI build passed
Details
@mattr- mattr- added a commit that referenced this pull request Sep 23, 2013
@mattr- mattr- Update history to reflect merge of #1574 93b5004
@edwardball edwardball deleted the unknown repository branch Sep 23, 2013
@robwierzbowski
Contributor

Thanks, @Aptary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment