nurkka Posted October 24 Share Posted October 24 When using LESS files in blocks, RockPageBuilder compiles them automatically (I believe by using RockFrontend) to one main.css file and includes it in the <head>. Is there any setting or config option to change the name main.css to something else? Link to comment Share on other sites More sharing options...
bernhard Posted October 24 Share Posted October 24 Hey @nurkka thx for your question! $rf = $this->rockfrontend(); if ($rf) $rf->styles()->addAll('/site/templates/RockPageBuilder', '', 3); this is what adds all blocks' .less files to the frontend. The default styles() array will compile files to main.css; I could either add a config setting to prevent this, or a module setting, or make it hookable. What would be the ideal workflow/result for you? Link to comment Share on other sites More sharing options...
nurkka Posted October 24 Author Share Posted October 24 Thanks @bernhard , I think it would be best, if there was a config setting and an option in the module settings UI. Then the option can be easily copied to other projects with the config.php and also has a visible representation in the UI. That would also be similar to the other options which are listed there, like e.g. "Create LESS file for new blocks". Link to comment Share on other sites More sharing options...
bernhard Posted November 3 Share Posted November 3 Hey @nurkka I've added a setting for you some time ago and think I forgot to mention that 🙂 Please check out v5.9.1 and mark this [solved] Link to comment Share on other sites More sharing options...
nurkka Posted November 3 Author Share Posted November 3 Thanks @bernhard ! I installed RockPageBuilder 5.9.1, but I can't find the setting anywhere and also in the docs. Sorry, perhaps I should call it a day for today and try again tomorrow 🙂 Link to comment Share on other sites More sharing options...
bernhard Posted November 3 Share Posted November 3 Maybe I mixed something up in my head?! I thought this was solving your problem. If not, could you please describe the problem again and with more details. Steps to reproduce, etc. Thx! Link to comment Share on other sites More sharing options...
nurkka Posted November 3 Author Share Posted November 3 Ah, yes, I am already using the feature to deactivate RockPageBuilder.min.css. The question why I started this thread was the ability to rename the CSS file which RockPageBuilder automatically generated from all block LESS files. The default is main.css and main.min.css, but I couldn't find any setting, where one could rename this CSS files. It would have been nice, to be able to rename the autogenerated CSS, but while finishing my last project, I came to the conclusion not to use the block LESS files, because personally, I am using SCSS for global styles, and so I wrote my block styles in my SCSS in another place. So in my case, the main.css is not generated by RockPagebuilder anymore. I would find it cool, if I could use the block style files again, but then only with SCSS and that would surely mean a lot of work on your part. So for now, we could leave this topic, as the feature to rename the main.css seems not to be needed right now. Link to comment Share on other sites More sharing options...
bernhard Posted November 3 Share Posted November 3 Ok thx. The reason why it ends up in main.css is actually 50% because of RockPageBuilder and 50% because of RockFrontend. RockPageBuilder adds something like this: rockfrontend()->styles()->addAll('/path/to/all/blocks'); This will tell RockFrontend to add all .less files to the main css file. You can tell it to rename this file, have a look here: https://www.baumrock.com/en/processwire/modules/rockfrontend/docs/asset-tools/ That means using the SCSS module it should also be possible to use ->addAll() and just place all .scss files in the block folders and let the module compile it to one file. Do you understand what I'm trying to say? 😅 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now