-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multisite Issue #77
Comments
If you set the name of your scss file to |
Sorry I'm not sure I got it. Would you mind providing more details or an example? Thx |
The best solution I can recommend is for you to make a child theme for each site. That way, changes that should affect all sites will go in the parent theme, and changes that should only affect one site go in that site's child theme. |
Actually no change should affect all sites. |
I think I may have misread your original post. The Customizer stores all of its settings in the database. It shouldn't be changing anything in a CSS (or even SCSS) file, so I would think that hitting Save, which makes it recompile, shouldn't be a problem, because wouldn't the CSS output just be the same? If your Customizer settings are getting propagated from one child site to all the rest, it seems to me that you have a bigger problem going on. |
Well hitting the 'Save' button does change something in the .scss file, what would be the point of recompiling then? :) I pass CSS related options (like colors and backgrounds) as variables to the .scss file, so I get as an output a customized version of theme.css The problem is kind of simple actually: Actually your child-theme hint is the best solution so far, as I'm able to copy the .scss file under a different name (e.g theme_1.scss) and enqueue the resulting theme_1.css instead, in child theme's Although this solution is far from being ideal.
by checking if Hope it makes more sense now :) |
Ah, ok. This is the problem. Your theme should be pulling in the Customizer settings from the database and generating inline CSS. If it did that, multisite would work the way it's intended to. |
Yeah the whole point is not to load dozens of lines of code on each page overriding other dozens of rules in the main CSS file. This system is way more efficient without affecting user experience as Live changes still work through JS. |
("Way more efficient" is debatable; while it may reduce unnecessary CSS, having a small bit of extra CSS is not likely to make a noticeable performance impact in the end user's browser.) Anyway... as your preferred way of doing this is definitely unconventional, I don't think |
Fair enough although to debate it you should also point out some cons of this approach, what you said still makes it (a lot or a little) more efficient over the old method. Anyway, again, the way I (and many other premium theme's authors) use a built-in compiler isn't the point really. If this is also not a real/common case scenario then I don't understand what's the point of this plugin to exist in the first place. ps: are you the plugin's developer? I'm not quite sure I got this |
My point is that WordPress is set up to do certain things in a standardized way, even if it isn't always the most optimal solution. The way most devs expect WordPress to work is that no part of WordPress changes any files except for the updater, the uploader, and the editor. Plugins do sometimes change files, but they usually only do it when they have a compelling reason to do so, and it's usually clear that files are being changed. The Customizer is expected to write settings to the database for the theme to use later, and not to change any files. Any visual settings that would be different on each sub-site should (1) be changeable in the Customizer and (2) be saved from there to the database, which allows WordPress to consistently load the right settings for each site into your theme without affecting the other sites. The point of this plugin is very simple - it lets you use SCSS files in your theme rather than just CSS. That's it. It has nothing to do with the Customizer, just like most theme's CSS files have nothing to do with the Customizer. If I were the plugin developer (which I'm not), I would say that the plugin should be written for a general audience, and what you're after is definitely not a normal usage. I've made my point -- it's up to the developers as to what they want to do. |
I know this thread is old, but @djwd if you want to submit a pull request, we'd be happy to review it. |
I was looking for a solution to this multisite problem as well. |
Hi there, thanks for your awesome plugin.
I'm requiring it for my next theme, but now an issue arose with a multisite install when setting up demos.
The compiler runs each time a the "Save" button is hit in the Customizer, updating the
theme.css
file.Since all sites are using the same theme, each time a visual setting is changed on one site, changes reflect to all sites of the network.
I guess I need the output to be something like
theme_[blog_id].css
in order to fix this.Letting the plugin enqueue the file didn't fix it, hence I guess multisite is not supported?
Do you have any hint on how I could approach this without editing plugin files?
Thank you
The text was updated successfully, but these errors were encountered: