Users are encountering a “can’t be published” error when adding custom CSS through Shopify’s theme customizer, particularly with the newer Custom CSS section editor.
Root Causes Identified:
Certain CSS properties are restricted or unsupported, including:
position: absolute (initially blocked, later reportedly fixed)
Properties requiring commas
content: "" in pseudo-elements
Complex transition properties in some cases
CSS selectors must target hardcoded theme elements, not custom liquid sections
Commented-out code in the editor can trigger the error
The editor sometimes corrupts CSS by adding unwanted content
Workarounds Suggested:
Add CSS directly to theme files (theme.css or base.css in assets)
Insert CSS within <style> tags in theme.liquid
Use Custom Liquid blocks with <style> tags for page-specific styling
Delete commented code before publishing
Current Status:
Shopify has documented official limitations (linked in thread). Some restrictions may be bugs under review, while others appear intentional. Users are encouraged to contact Shopify support to report issues and request feature improvements.
Summarized with AI on October 31.
AI used: claude-sonnet-4-5-20250929.
The suggestions given above are obviously useless because we know that we can use CSS files to style the theme but the idea here is to use shopify’s new section ad it doesn’t seem to be working…
EDIT: Shopify support says that you can’t use position: absolute in the custom CSS editor (like at all??) and you also need the selector you are trying to apply be apart of the hardcode, it can’t be a custom liquid section or something like that… Seems like two kind of dumb limitations to me but maybe that will be fixed soon.
In addition the editor is butchering some of my CSS and adding its own stuff in it like it thinks its part of the selector:
I’m also getting the same error and it only happens when I try to make the position absolute in the custom CSS section, which is exactly what I need ONLY for that specific page. If I change it in a asset file it changes the whole website. Any fixes so I can make it absolute?
I’m also having issues but found a workaround to use all the css selectors which aren’t yet supported.
Probably not a recommended solution but it works for me:
Find the page you are trying to modify in Customizer.
Add a Custom Liquid Block at the bottom of the page and set margins to 0 or very small.
In the Custom Liquid block use the tag and enter your custom CSS in between
No more issues.
A good workaround if you’re just trying to edit one page (and you can always create a new template for that page if required). If you need the change across the whole site you could duplicate these steps on every page but it would get pretty repetitive.