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:

<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

zapbrannigan1972
 
Gondwana replied on at Permalink Reply
Gondwana
This isn't an answer, but making changes to any file in /concrete/ is a bad idea because it will probably get nuked whenever your c5 installation gets upgraded.

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.
bcron replied on at Permalink Best Answer Reply
bcron
Fundamental Theme is a paid theme.
Install "Cloneamental" which is an exact clone of Elemental.
Gondwana replied on at Permalink Reply
Gondwana
Oops; you're right, of course!

Gondwana -= karma
Gondwana replied on at Permalink Reply
Gondwana
stewblack23 replied on at Permalink Reply
stewblack23
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.
Gondwana replied on at Permalink Reply
Gondwana
I think you also need to mess around with namespaces if you do it this way. Fundamental has already done this.
stewblack23 replied on at Permalink Reply
stewblack23
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.
zapbrannigan1972 replied on at Permalink Reply
zapbrannigan1972
Hi all! Massive thanks, cloneamental worked an absolute treat. Fantastic!! Thank you so very much!!!