Referencing a new CSS
Permalink 1 user found helpful
Hi, using the elemental theme and now adding my own styles to it by using a new css (or happy to use a SASS or LESS file) and I've referenced the new CSS in the header_top.php in the /concrete/themes/elemental/elements folder:
Just above the meta tag:
Locally, it works fine, but as soon as I upload the new php and the linked CSS to my server, the CSS is not being referenced at all (view source) and with all caching turned off I'm at a lost as to what I've done wrong.
Tried to add a custom less to the build folder and added to the main.less and still nothing.
Cheers,
Andy
<link rel="stylesheet" type="text/css" href="<?php echo $view->getThemePath()?>/css/my-bespoke-styles.css">
Just above the meta tag:
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Locally, it works fine, but as soon as I upload the new php and the linked CSS to my server, the CSS is not being referenced at all (view source) and with all caching turned off I'm at a lost as to what I've done wrong.
Tried to add a custom less to the build folder and added to the main.less and still nothing.
Cheers,
Andy
Fundamental Theme is a paid theme.
Install "Cloneamental" which is an exact clone of Elemental.
Install "Cloneamental" which is an exact clone of Elemental.
Oops; you're right, of course!
Gondwana -= karma
Gondwana -= karma
I would suggest copying the elemental theme folder from /concrete directory and putting it in your /applications/theme directory. Then just name the theme something else and activate it.
This will help avoid any issues modifying files in C5 core directory. Then in the elements folder open up the header_top.php file. In the opening body tag put a class called override. Now any css you want to override just put the .overrde class in front of it and your class will take precedence.
This will help avoid any issues modifying files in C5 core directory. Then in the elements folder open up the header_top.php file. In the opening body tag put a class called override. Now any css you want to override just put the .overrde class in front of it and your class will take precedence.
I think you also need to mess around with namespaces if you do it this way. Fundamental has already done this.
Gondwana you are correct. Andy, if you do it the way I suggested, you have to go into the page_theme.php file and change the namespace path at the top of the file to match the new directory.
Hi all! Massive thanks, cloneamental worked an absolute treat. Fantastic!! Thank you so very much!!!
If you need to make significant changes to Elemental, look up Fundamental.
I suspect an easier solution may be something like /application/themes/elemental/css/my-styles.css.