Is it possible to add individual CSS file on each cms page? Upon researching, I can do it by adding code on Layout update XML.
Unfortunately, it isn't working. Here's my code:
<head> <css src="Namespace_YourModule::css/styles.css"/> </head>
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.Sign up to join this community
<?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/mycustom.css" after="-" /> </head> </page>
If you're on < version
2.1.9 there was apparently a bug to prevent this from working, I've never tried it but you can read about it here - Adding CSS to a CMS page using Layout Update XML