-
Notifications
You must be signed in to change notification settings - Fork 1
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
Custom CSS rules from admin #42
Comments
@kilichenko-pixida in your subsite you override the custom_theme.html and removed the injected theme from admin (see this part in geonode-mapstore-client).
With extends you will keep the other existing blocks in the snippet |
@allyoucanmap thank you for the answer Could you please give me an example how would the contents of the "Custom CSS rules" look like in either case? For exmaple if I only wanted to apply the following : I tried both removing custom_theme.html and adding the styles like here, but still didn't get any changes to apply. |
@kilichenko-pixida in the docs for geonode-mapstore-client there is a tool Theme variables generator to generate a theme: the generate style uses :root as selector, maybe this will work |
Tried both {% endblock %}` and just both with and without the custom_theme.html overwritten. No result unfortunately |
@kilichenko-pixida could you try it without extending, but embedding the <style>
.msgapi .gn-theme {
/* keep default styling */
}
</style>
<style>
{{ custom_theme.extra_css }}
</style> Then, put the following in the custom css rules form of subsite's theme: .msgapi .gn-theme {
--gn-button-primary-bg: #ff0000;
} |
That worked! |
@allyoucanmap Thanks for the pointer of the missing I just played around with it and it seemed the last rules defined win. Wouldn't it be better to place the custom css block under the actual content block to ensure overriding via extra rules take effect? Not sure, if this was the actual problem here, though |
@ridoo @kilichenko-pixida in case you need to overrides rules the order matter but in CSS we could also use a specific selector to give priority to the variables. Usually when making theme in geonode, we are applying the
and then use
|
TIL |
We've integrated the subsites into thuenen, on the branch subsite_holisoils.
We were able to apply CSS styles from e.g. at
geonode/templates/subsites/holisoils/geonode-mapstore-client/snippets/custom_theme.html
, however, when we tried doing it directly from the admin panel (from the subsite theme settings, "Custom CSS rules" field), they don't seem to apply.We've been just adding
.msgapi .gn-theme { --gn-main-color: #000000; --gn-main-bg: #ffffff; ... }
which works when used in
custom_theme.html,
but not when applied from admin.Perhaps there is a special trick to it? How should it be done?
The text was updated successfully, but these errors were encountered: