Skip to content

Commit

Permalink
remove variant theme in favor of extra_css block (#825)
Browse files Browse the repository at this point in the history
  • Loading branch information
allyoucanmap authored Feb 14, 2022
1 parent 957d6ba commit 07eec27
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 22 deletions.
2 changes: 1 addition & 1 deletion docs/customizations/theme.html
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ <h1>GeoNode Theme</h1>
function renderLessVariables(init) {
less.render(text + extraLess + ' .gn-theme { .extract-css-variables(@gn-theme-vars); }', { modifyVars: params }, function (error, output) {
document.getElementById('gn-css-variables').innerHTML = output.css;
textarea.innerHTML = '<!-- copy this style in the custom_theme.html template to apply these new theme variables -->\n<style>\n' + output.css + '</style>';
textarea.innerHTML = '/* copy this style in the "Custom CSS rules" field of the theme page to apply these new variables */\n' + output.css + '';
if (init) {
loadCount++;
loaded();
Expand Down
12 changes: 0 additions & 12 deletions geonode_mapstore_client/client/themes/geonode/less/geonode.less
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,3 @@
.write-ms-theme(@gn-theme-vars);
#gn-base-components-theme(@gn-theme-vars);
#gn-components-theme(@gn-theme-vars);

// ****************
// default theme
// ****************
.gn-theme-light {
.extract-css-variables(@gn-theme-vars);
}

// ****************
// theme variants
// ****************
@import 'variants/dark.less';
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

// example of a theme variant
// this is not included in the theme
.gn-theme-dark {

@gn-main-color: #dddddd;
Expand Down
2 changes: 1 addition & 1 deletion geonode_mapstore_client/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{% endblock %}


{% block body_extra_class %}gn-legacy gn-theme gn-theme-{{ custom_theme.variant }} {% if request.user_agent.is_mobile %}gn-mobile{% else %}gn-desktop{% endif %}{% endblock %}
{% block body_extra_class %}gn-legacy gn-theme {% if request.user_agent.is_mobile %}gn-mobile{% else %}gn-desktop{% endif %}{% endblock %}

{% block header %}
{% include './geonode-mapstore-client/snippets/header.html' %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
{% block gn_config %}
{% include 'geonode-mapstore-client/_geonode_config.html' with plugins_config_key='document_embed' is_embed='true' %}
{% endblock %}
<div class="gn-embed gn-theme gn-theme-{{ custom_theme.variant }}">
<div class="gn-embed gn-theme">
{% block container %}
<style>
.msgapi .gn-media-viewer {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
{% block gn_config %}
{% include './_geonode_config.html' %}
{% endblock %}
<div class="gn-catalogue gn-theme gn-theme-{{ custom_theme.variant }}">
<div class="gn-catalogue gn-theme">
{% block header %}
{% include './snippets/header.html' %}
{% endblock %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
{% block gn_config %}
{% include './_geonode_config.html' with plugins_config_key='dashboard_embed' is_embed='true' %}
{% endblock %}
<div class="gn-embed gn-theme gn-theme-{{ custom_theme.variant }}">
<div class="gn-embed gn-theme">
{% block container %}
<div id="ms-container">
<div class="gn-main-event-container">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
{% block gn_config %}
{% include './_geonode_config.html' with plugins_config_key='dataset_embed' is_embed='true' %}
{% endblock %}
<div class="gn-embed gn-theme gn-theme-{{ custom_theme.variant }}">
<div class="gn-embed gn-theme">
{% block container %}
<div id="ms-container">
<div class="gn-main-event-container">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
{% block gn_config %}
{% include './_geonode_config.html' with plugins_config_key='geostory_embed' is_embed='true' %}
{% endblock %}
<div class="gn-embed gn-theme gn-theme-{{ custom_theme.variant }}">
<div class="gn-embed gn-theme">
{% block container %}
<div id="ms-container">
<div class="gn-main-event-container">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
{% block gn_config %}
{% include './_geonode_config.html' with plugins_config_key='map_embed' is_embed='true' %}
{% endblock %}
<div class="gn-embed gn-theme gn-theme-{{ custom_theme.variant }}">
<div class="gn-embed gn-theme">
{% block container %}
<div id="ms-container">
<div class="gn-main-event-container">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@

<style>
{% block extra_css %}
{{ custom_theme.extra_css }}
{% endblock %}
</style>
{% block content %}
{% comment %}
<!-- example of custom theme -->
Expand Down
2 changes: 1 addition & 1 deletion geonode_mapstore_client/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</head>
<body class="msgapi ms2" data-ms2-container="ms2">
<div class="gn-page-wrapper {% if request.user_agent.is_mobile %}gn-mobile{% else %}gn-desktop{% endif %}">
<div class="gn-theme gn-theme-{{ custom_theme.variant }} gn-homepage">
<div class="gn-theme gn-homepage">
{% include './geonode-mapstore-client/_geonode_config.html' %}
{% block header %}
{% include './geonode-mapstore-client/snippets/header.html' with show_hero=True %}
Expand Down
2 changes: 1 addition & 1 deletion geonode_mapstore_client/templates/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<body class="msgapi ms2" data-ms2-container="ms2" >
<div class="gn-page-wrapper {% if request.user_agent.is_mobile %}gn-mobile{% else %}gn-desktop{% endif %}">
{% include './geonode-mapstore-client/_geonode_config.html' %}
<div class="gn-theme gn-theme-{{ custom_theme.variant }} gn-homepage">
<div class="gn-theme gn-homepage">
{% block header %}
{% include './geonode-mapstore-client/snippets/header.html' %}
{% endblock %}
Expand Down

0 comments on commit 07eec27

Please sign in to comment.