Closed f-necas closed 6 months ago
Seems better / good idea to get a default georchestra theme with the right colors.
This methods needs to be documented somewhere.
Can be backported to 2023.02.xx
please, not a horrible script shell lost in a ticket somewhere :)
there are two things at stake here:
Thinking out loud idea, why not having some controller reading /etc/georchestra/mapstore/georchestra.css
? after all the datadir feature is integrated to read properties files, the new geor header is integrated and configurable via the datadir, so why not doing the same for ms2 ? or like georchestraStylesheet
in default.properties
?
this way you commit the change to index.html
& indexTemplate.html
and the default css override is read for everyone from the datadir ?
georchestraStylesheet
@landryb this could be a new param to develop ?
@f-necas did you already check what documented here?
Thanks @tdipisa, We have already read this documentation but :
The build needs to be a technician - not really easy for a simple mapstore /SDI administrator to create a custom theme reusable from every mapstore context
Custom Theme for contexts is not easy to read if a user customize many variables / many themes from localConfig.json
So, this PR is a method that just change the default theme according to georchestra's color and insert new variables names to easily override this default theme without build again mapstore or create regression.
Hi all !
Thanks for your comments and reviews. Indeed we checked the documentation but as Gaetan said, the purpose here is to allow customization without building the whole app.
To solve landry's question, georchestra's stylesheet can already be set in localConfig.json
to style the header. We can also, if the variable is set, create an html link to style mapstore without having to edit index.html
and indexTemplate.html
. Makes sense for me .
Hi all !
To solve landry's question, georchestra's stylesheet can already be set in
localConfig.json
to style the header. We can also, if the variable is set, create an html link to style mapstore without having to editindex.html
andindexTemplate.html
. Makes sense for me .
so the same css would be applied to style the webcomponent header and mapstore ? sounds... interesting :) !
@f-necas A well-integrated georchestra colour :D :
Tested but not really sur to use the config correctly.
Here a stylesheet modification (loaded with stylesheetUri) result. My rules are not really reads as prior rules.
This gift show steps :
Here the stylesheet used by localConfig.json
file (in datadir) with stylesheetUri
param :
body {
--georchestra-primary: rgb(125, 160, 157);
--georchestra-secondary: rgb(0, 122, 128);
--georchestra-primary-light: white;
--georchestra-secondary-light: #eee;
--georchestra-ms-button-primary-bg: rgb(125, 160, 157);
--georchestra-ms-button-primary-border-color: rgb(125, 160, 157);
--georchestra-ms-button-primary-disabled-bg: rgb(125, 160, 157);
}
/* Mapstore */
.geOrchestra[data-ms2-container="ms2"] {
--georchestra-ms-primary: var(--georchestra-primary);
--georchestra-ms-main-variant-color: rgb(0,58,59);
--georchestra-ms-button-primary-bg: rgb(125, 160, 157);
--georchestra-ms-button-primary-border-color: rgb(125, 160, 157);
--georchestra-ms-button-primary-disabled-bg: rgb(125, 160, 157);
}
Tested but not really sur to use the config correctly.
Works well after correctly insert Easytheming plugin in Desktop/Mobile section (localConfig.json file).
See result here (buttons colors come from custom stylesheet):
so now that i've looked at the current PR code, my understanding is:
stylesheet
param for the easytheming
plugin in localConfig.json
easytheming
plugin in the context editor, pointing at another stylesheet
that will override the one set in localConfig.json
. right ?
Also i think that 'extends' (not 'conflicts with ') what can be done with the existing ms2 theming panel in the context creator where the amount of options is limited, while with this easytheming
plugin technically all css classes can be overriden.. is that right too ?
Hi Landry,
That's right for the first two points. For the last one (maybe @Gaetanbrl could be more precise on it), The theme configured with easy should be override by the settings we set while creating the context.
So :
localConfig.json
And you're right, css classes should be ovveridable.
and one can configure the easytheming plugin in the context editor
Easytheming seems not configurable in context editor UI. To change it with this code, change localConfig.json
file. Right @f-necas ?
Easytheming seems not configurable in context editor UI. To change it with this code, change
localConfig.json
file. Right @f-necas ?
well, then that'd be a major drawback, because from my understadning the point was to allow users not having access to the datadir to point to externally hosted css files.. using the context editor.
and one can configure the easytheming plugin in the context editor
Easytheming seems not configurable in context editor UI. To change it with this code, change
localConfig.json
file. Right @f-necas ?
Right, the plugin is configurable only with localConfig.json
. But context editor keep its logic when users defines variables for their context.
@landryb the context editor stay as it is :)
Right, the plugin is configurable only with
localConfig.json
. But context editor keep its logic when users defines variables for their context.
that's sad because in my opinion it will miss most targets, eg users who don't have access to customize localConfig.json
@landryb the context editor stay as it is :)
i wasnt saying the context editor should be modified at all, rather that if easytheming
is a plugin like others, then it can be configured/should be configurable as other plugins in the context editor plugin configuration panel.... which is accessible to more users than users able to access the server/modify localConfig.json
.
if easytheming is a plugin like others, then it can be configured/should be configurable as other plugins in the context editor plugin configuration panel
Maybe there is some misunderstanding here ?
From what I understand, this plugin is not a classical plugin. Easytheming ease the way to change the default mapstore theme (as ADMIN can do generaly with build command + CSS). This plugin is about global MapStore theme and global CSS variables (e.g change default mapstore colors) and he is not a map plugin / functionallity (so not a plugin configurable from context editor).
ah, then i misunderstood the original intent, my bad :)
This steps needs to be documented soon :
thememapstore.css
) from attached .txt
file (rename this file with .css
extension)CSS
file in a web server/etc/georchestra/mapstore/configs/localConfig.json
stylesheetUri
key with CSS
file path as valuelocalConfig.json
fileThis change don't need to restart any tomcat service because localConfig.json is loaded each time a card / context is opened.
Here example to change to CSS extension (github don't allow to attach .css
file):
thememapstore.txt
This PR allows to use another css file (and keeping mapstore context themes) without the need to rebuild app.
CSS file must be provided with another web server and link must be added in
index.html
andindexTemplate.html
Example of sh file to update it :
Example of css file :