1

I have downloaded and installed the latest version of Magento 2 on my localhost, i have made a custom theme and now my problem is that i can't change any css ! I have created my css file in /app/design/frontend/Vendor/Themename/web/css/style.css and included it in Vendor/themename/Magento_Theme/layout/default_head_blocks.xml like this:

    <?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <css src="css/style.css" />
    </head>
</page>

After this I tried this command:

php -dmemory_limit=6G bin/magento setup:static-content:deploy ro_RO

I got this in the console:

    Running "less:themename" (less) task
File pub/static/frontend/Vendor/themename/ro_RO/css/styles-m.css created: 284.76
kB → 491.43 kB
File pub/static/frontend/Vendor/themename/ro_RO/css/styles-l.css created: 51.08 k
B → 90 kB

Done, without errors.

Still nothing on frontend, i tried this command too: grunt less:themename No changes on frontend. Does anybody have an idea why this is not working ?

0

Checking Ctrl+U CSS add or not. If already add that CSS apply. define in layout file module name and deploy again.

<head>
    <css src="Namespace_ModuelName::css/style.css"/>
</head>
0

Use code in the below format

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/>
    <css src="custom.css"/>
    </head>
</page>

Inside your theme and a custom.css file name in the web/css folder...

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.