Post by maffe » Fri Jan 03, 2025 5:42 pm

I have a feeling (assumption) that there is still a lot of old, outdated code in the stylesheet from the past, such as from IE6, etc.
Has anyone ever worked on this and significantly cleaned up and shortened the stylesheet?
And would they be willing to share it with us?
For example, there are multiple media rules with 768, 767, max-, and min width lines, along with a lot of other stuff.

Active Member

Posts

Joined
Sun Jun 12, 2011 5:21 am
Location - Lelystad

Post by JNeuhoff » Fri Jan 03, 2025 7:13 pm

Please read the forum rules, and then try again, with some more details. Media rules are there for a purpose for the responsive default theme in conjunction with bootstrap 3.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by paulfeakins » Fri Jan 03, 2025 8:17 pm

maffe wrote:
Fri Jan 03, 2025 5:42 pm
I have a feeling (assumption)
Let me stop you there. Read the CSS and come back to us with facts.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by maffe » Fri Jan 03, 2025 11:24 pm

Okay, maybe the wording "I have a feeling (assumption)" wasn't very handy :)

A few examples of possible improvements that can be made in the stylesheet:
- h1, h2, h3, h4, h5, and h6 are defined multiple times.
- Line 771 has an issue with: margin-top: 4px\9;. The \9 is no longer needed and can be removed, as modern browsers no longer require this 'hack'.

I will go forward and remove the specific Internet Explorer 6, 7, and 8 codes.
I want to get the stylesheet to a minimum of below 500 lines.

My question was: If someone has already done this, it would save me time...

And take a look yourself. Upload the 807 lines of CSS code here: https://csslint.net/

Active Member

Posts

Joined
Sun Jun 12, 2011 5:21 am
Location - Lelystad

Post by by mona » Sat Jan 04, 2025 4:21 am

It is an automated tool that is not very sophisticated.


maffe wrote:
Fri Jan 03, 2025 11:24 pm
h1, h2, h3, h4, h5, and h6 are defined multiple times.
More bytes would be used to define once and include colour on each font. Better the way it is.


maffe wrote:
Fri Jan 03, 2025 11:24 pm
The \9 is no longer needed and can be removed
Some people support all browsers, some places have more old browser usage than others.


maffe wrote:
Fri Jan 03, 2025 11:24 pm
I will go forward and remove the specific Internet Explorer 6, 7, and 8 codes.
Some people ignore support for IE all together


maffe wrote:
Fri Jan 03, 2025 5:42 pm
there are multiple media rules with 768
.

Yes, I can not be sure without actually looking into it, but due to css being cascading I suspect it is the reason. It probably can be improved.


All sites are unique. Better to finish a site, compress the css and remove all unnecessary code at the end. Google developer tools now include a beta tool for testing and helping you "perfect" your site.

For a imperfect fix that does not require effort, search google for minimising css and some of them have options for exactly which browsers you want to support.
Job done.

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am
Who is online

Users browsing this forum: Semrush [Bot] and 14 guests