cancel
Showing results for 
Search instead for 
Did you mean: 

My css is not working in magento 2

SOLVED

My css is not working in magento 2

I had installed magento 2.0.2 and also override the templates I am stuck on a point that where do i write my css for my own styling. How do i change the css of existing template. i have done these steps create _theme.less

app/design/frontend/vendor/theme/web/source/_theme.less

and deploy the content by using

php bin/magento setup:static-content:deploy

also change the Front-end development workflow into client side less compilation and i found the styles.css file included at backend which source was

pub/media/styles.css

if i make changes in styles.css then it will apply on frontend and backend both. now i want to write my own css to apply my own created theme how can i do that?

thanks alot!

1 ACCEPTED SOLUTION

Accepted Solutions

Re: My css is not working in magento 2

How to add JavaScript / CSS / Less with a custom module: https://mage2.pro/t/34

View solution in original post

3 REPLIES 3

Re: My css is not working in magento 2

How to add JavaScript / CSS / Less with a custom module: https://mage2.pro/t/34

Re: My css is not working in magento 2

Make sure your tree looks like this:

-app
--design
---frontend
----VendorName
-----VendorTheme
------Magento-Theme
-------layout
--------default.xml
--------default_head_blocks.xml
------media
-------preview.png
------web
-------css
--------yourcss.css
------registration.php
------theme.xml

Re: My css is not working in magento 2

you also have to make sure that your .htaccess in the static folder has not been accidentally deleted (if you are using apache).

 

for nginx you'll have to add the appropriate rules as provided in their sample nginx config.

 

you also have to clear out the var/view_preprocessed folder.

 

you can also try using this instead, it's much better

 

https://github.com/SnowdogApps/magento2-frontools