Digital experiences for all disciplines
New Landing › How can we help? › Cardinal Theme Support › Cardinal – Feature Request › Minify custom admin css output in source code?
New Landing › How can we help? › Cardinal Theme Support › Cardinal – Feature Request › Minify custom admin css output in source code?
- This topic has 7 replies, 2 voices, and was last updated 9 years by Kyle – SUPPORT.
-
Posted in: Cardinal – Feature Request
-
September 21, 2014 at 9:17 pm #113080
Hey,
I am currently trying all kinds of way to optimise loads times of cardinal and my websites.
One thing I noticed is that when you go into the source, you can see that the outputted rules from the color customizer are minified (no whitespace etc). On the other hand, the cardinal admin custom css rules that are outputted in the source are not minified.
I have approaching 1500 lines of custom css (a lot, I know) on one of my sites. I am open to correction, but would it not help with load times (even if its just a small amount) if you were to somehow minify those outputted custom admin css rules just like the color customizer does?
At the very least, it would significantly reduce the line count of the source code…
Screenshot attached to illustrate my point.
Attachments:
You must be logged in to view attached files.September 22, 2014 at 10:17 am #113232Hi
If you have a lot of custom css, you should be using a child theme, with the custom css in a style.css file.
If you want to minify your css you can do so here: http://cssminifier.com/
– Kyle
September 22, 2014 at 10:22 am #113234Hey,
#1. There is a reason I need to continue using the custom css instead of the child theme on one of my sites. Basically, you cannot get some of my rules to work in the child theme unless you put the !important declaration after each of them. That is not ideal as I have created a style-switcher plugin to work with Cardinal and if the !important declaration is added, the switcher cannot change the color scheme of the particular element etc.
#2. That css minifier link would do nothing for what I asked about – I have no control over how the cardinal admin custom css is outputted in the source code – that can only be modified at the theme framework level…
September 22, 2014 at 10:29 am #113238The output will be exactly what you add to the custom css box, so if you add the minified version then that’s what will be outputted in the source
– Kyle
September 22, 2014 at 10:31 am #113239Ah, I see what you mean.
Do you think it will have any noticeable impact on page load?
September 22, 2014 at 10:36 am #113242Yes a minified version will, however the best thing to do would be to put as much of your custom CSS into a child theme style.css file, and any that you need to remain in the theme options you can leave there
– Kyle
September 22, 2014 at 10:39 am #113243Yea good plan. Going to start doing that today.
I should be able to move most of the rules to the child theme css – I will just keep the background, background-color and color rules in the custom css; as I said above, using the !important declaration on them impacts upon my style-switcher color changer.
September 22, 2014 at 10:53 am #113250No problem
-
Posted in: Cardinal – Feature Request
You must be logged in and have valid license to reply to this topic.