April 30, 2016 in Developer Connection
Note: Haven't looked at method directly.
I've had great success dropping in my own css files into the custom css directory for themes. My files load and custom.css still over-rides the junk in my files.
Coincidentally those files of mine either began with the letter A or B. I say this as I saw that Dylan Riggs was sticking all of his theme mod css for Krocan into custom.css directly which will over-write any changes end-users have made anytime theme updates are uploaded.
I asked why and he stated that when he stuck them into krocan.css his file over-wrote custom.css. My bet is that the custom directory is being read out sequentially (alphabetically). So my css files starting with A or B are fine as custom.css will be read after those, and Dylan's krocan.css file will break custom.css as it will be read in afterwards - which is why he just stuck everything into custom.css
The solution is just to name our css files in the custom directory with anything that would load in alphabetically before the word custom; "a" solution but not the best.
My request is for some better handling here. core-front currently contains custom, extra, and styles. Perhaps creating another directory called theme and reading the contents immediately prior to the custom dir.
That or you could read all the files out of custom into an array, and pull out custom.css to always be read last.
Adopting this change will allow theme designers to confidently drop in their own files without ever having to touch custom.css
This topic is now archived and is closed to further replies.
Pushpendra Singh Chauhan
Started September 28, 2022
Started 9 hours ago
Started November 9, 2021