I’ve successfully applied custom CSS using the Customize->CSS/HTML UI, but I would rather package the styling changes with my plugin. I’ve seen examples of plugins using register_asset in plugin.rb to add CSS. I created a *.scss file under my plugin assets directory, but when I restart the server, the styling is not applied even though the plugin is enabled and working. I believe the file is being loaded, as I originally had a typo in the path, and the server reported that it was unable to find the asset (fixing the path eliminated that error message). I’ve tried registering the asset as common and desktop (I am using a laptop) without luck. Are there additional steps needed to enable CSS customizations when using this approach?
AI-generated summary
In the discussion regarding customizing CSS via a plugin, swohlever reported successfully applying custom CSS through the UI but encountered issues when attempting to package styling changes within a plugin. Despite creating a .scss file in the plugin’s assets directory and confirming the file path was correct (as initial path errors were resolved), the styles were not applied upon server restart, even when registering the asset for common and desktop themes. Falco suggested that the issue might stem from incomplete cache clearing, a common problem when creating or deleting files. They recommended removing the tmp folder and restarting Rails to force a cache refresh, citing a known workaround from eviltrout. swohlever confirmed that this solution resolved the problem, noting that the CSS was successfully applied after clearing the cache.
Did you try this? ![]()
That did it. Thanks!.