Skip to content

How can I add a custom stylesheet to my custom theme?

I am losing my mind because I am following guidance in documentation but literally nothing works.

I added a custom theme that references luma. my directory structure is /app/design/frontend/Localstretch/luma_child

In my luma_child/web/css folder I put localstretch.css

In my /app/design/frontend/Localstretch/luma_child/Magento_Theme/layout/default_head_blocks.xml

I added the following:

<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/localstretch.css" rel="stylesheet" type="text/css"  />
    </head>
</page>

I cleared cache php bin/magento cache:flush
then did php bin/magento setup:static-content:deploy

but I still can’t see my css being loaded.

I had also deleted folder for another theme I added but that is still showing in admin. What gives?