1

My default_header_block.xml path is enter image description here

app/design/frontend/custom-theme/my-first-theme/Magento_Theme/layout/default_head_blocks.xml

my css file

app/design/frontend/custom-theme/my-first-theme/web/css/abc.css

But my abc.css file loaded inside following structure enter image description here

pub/static/frontend/custom-theme/my-first-theme/en_US/css/abc.css

it will not display source path.. enter image description here

I followed the below steps to clear cache:

remove files inside 'var' folder and inside pub/static/frontend

How can I display my Custom css source link in website?

  • Did you ran the php bin/magento s:s:d and followed by php bin/magento c:f – dev_67Commerce Jan 30 '18 at 13:17
7

In order to do add custom css and load last, you must set up a custom theme.

app / design / frontend / [vendor] / [theme] / Magento_Theme / layout app / design / frontend / [vendor] / [theme] / web / css

Create the following files:

app / design / frontend / [vendor] / [theme] / Magento_Theme / layout / default_head_blocks.xml
app / design / frontend / [vendor] / [theme] / web / css / local-m.css app / design / frontend / [vendor] / [theme] / web / css / local-l.css

place this code within default_head_blocks.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/framework/Module/etc/module.xsd">
  <head>
    <css src="css/local-m.css" />
    <css src="css/local-l.css" media="screen and (min-width: 768px)"/>
  </head>
</page>

php bin/magento setup:static-content:deploy

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.