0

probably missing something simple here, but I can not get my css to load after adding it to new child theme

Here is my folder structure

enter image description here

I have added the following into my /layout/default_head_blocks.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
 <css src="css/styles-m.css" />
 <css src="css/custom.css" media="screen and (min-width: 768px)"/>
 <css src="css/print.css" media="print" />
</head>

And the header in my sit has changed and is referencing the files in the tag as expected

<title>Home page</title>
<link rel="stylesheet" type="text/css" media="all" href="http://dev.modzinc.co.uk/pub/static/version1487891140/frontend/Modzinc/basic/en_GB/css/styles-m.css" />
<link rel="stylesheet" type="text/css" media="screen and (min-width: 768px)" href="http://dev.modzinc.co.uk/pub/static/version1487891140/frontend/Modzinc/basic/en_GB/css/styles-l.css" />
<link rel="stylesheet" type="text/css" media="screen and (min-width: 768px)" href="http://dev.modzinc.co.uk/pub/static/version1487891140/frontend/Modzinc/basic/en_GB/css/custom.css" />

put when I open the url : http://dev.modzinc.co.uk/pub/static/version1487891140/frontend/Modzinc/basic/en_GB/css/custom.css

I get this error

Unable to resolve the source file for 'frontend/Modzinc/basic/en_GB/css/custom.css'
#0 /home/ubodoco/public_html/dev/vendor/magento/framework/App/StaticResource.php(97): Magento\Framework\View\Asset\File->getSourceFile()
#1 /home/ubodoco/public_html/dev/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\StaticResource->launch()
#2 /home/ubodoco/public_html/dev/pub/static.php(13): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\StaticResource))
#3 {main}

Through the command line I have tried setup:upgrade , Cache:clean , cache:flush and nothing will make it work ??

Any ideas on what I am doing wrong

thanks

asked Feb 23, 2017 at 23:18
0

2 Answers 2

0

Have you run php bin/magento setup:static-content:deploy? All of your theme assets need to be compiled into the pub/static/ folders, so check the path is is giving you an error:

pub/static/frontend/Modzinc/basic/en_GB/css/custom.css

and see if your .css file is in there. If it's not, run the setup command above.

answered Feb 23, 2017 at 23:53
0

Looks like the static files are trying to get a specific version in there.

Building on what @circlesix said...

Clear out your pub/static/frontend and var/view_preprocessed folders, clear your cache and run php bin/magento setup:static-content:deploy en_GB from your root directory again

This should clear the version and your CSS file should start working.

Double check the file exists in

 pub/static/frontend/Modzinc/basic/en_GB/css/custom.css
answered Feb 24, 2017 at 17:28

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.