I am trying to include a CSS from a jQuery library that I have within Magento_Theme/web/js/libs/ folder, however, I am struggling to source a CSS file from within here?
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<css src="Magento_Theme/web/js/libs/slick/styles.min.css" />
</head>
</page>
How can I do this? I can only seem to source css from within the root/web folder within my theme if I was to use:
<css src="css/styles.min.css" />
Technocracker
2,0371 gold badge15 silver badges26 bronze badges
2 Answers 2
Got it working :)
<css src="Magento_Theme::js/libs/slick/slick.css" />
answered Jan 5, 2018 at 17:15
lky
7972 gold badges20 silver badges36 bronze badges
I've never done this but give this a try:
<css src="Magento_Theme::js/libs/slick/slick.css" />
All I've done is remove web as it isn't required, and changed / to :: (that you noticed xD)
answered Jan 5, 2018 at 17:10
Ben Crook
15.8k4 gold badges53 silver badges105 bronze badges
-
Thanks Ben, the above code didn't work but pointed me in the right direction :) I changed it to follow the same structure as adding blocks :) See my answer....lky– lky2018年01月05日 17:16:36 +00:00Commented Jan 5, 2018 at 17:16
-
FML, I forget that the
/should be::at least once a week. I'll update this even though you've already fixed it.Ben Crook– Ben Crook2018年01月05日 17:18:29 +00:00Commented Jan 5, 2018 at 17:18
default