0

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
asked Jan 5, 2018 at 17:05

2 Answers 2

1

Got it working :)

<css src="Magento_Theme::js/libs/slick/slick.css" />
answered Jan 5, 2018 at 17:15
1

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
2
  • 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.... Commented 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. Commented Jan 5, 2018 at 17:18

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.