How to apply css in theme development
Created 7 years ago by ankitasoman

Hi @ryanthompson, I am developing theme for my website. I am just stuck while linking and applying my css to the pages. metadata file contains the following snippet: {# Include Styles Loaded From Outside #} {% for style in asset_styles("styles.css") %} {{ style|raw }} {% endfor %}

I have created a directory named styles in resources directory of theme, and styles.css contains the css code. But styling does not get applied on page. How to do this??

piterden  —  7 years ago

Did you try this? {{ asset_add("styles.css", "vendor.type.slug::css/style.css") }}

ankitasoman  —  7 years ago

@piterden its not working 🙍

piterden  —  7 years ago

vendor.type.slug must be yours. Show me, what did you write?

ankitasoman  —  7 years ago

Hi @piterden it worked, I 've done that using sass. I just got confused in linked build.css file in metadata.twig. I got it. Thanks for the suggestion.