-
Notifications
You must be signed in to change notification settings - Fork 25
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
Allow theming mapstore with another css file #709
Conversation
d416c0f
to
74cfa65
Compare
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 this way you commit the change to |
@landryb this could be a new param to develop ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @tdipisa, We have already read this documentation but :
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 |
so the same css would be applied to style the webcomponent header and mapstore ? sounds... interesting :) ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR.
Out of comment, if the context editor style selector (last step) keep working, this seems nice enhancement.
In addition, is this param (stylesheet
) documented somewhere ? If not, is the README the best place ?
js/plugins/Header.jsx
Outdated
@@ -31,6 +31,13 @@ export const Header = ({url = "/header/", page = "mapstore", height = 90, ignore | |||
header.setAttribute("logo-url", logoUrl); | |||
header.setAttribute("stylesheet", stylesheet); | |||
headerScript.src = script; | |||
if (stylesheet) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it could be interesting to use / loop over an array of stylesheet (to separate header stylesheet and mapstore stylesheet) ?
3c1e3e6
to
6ba8f3b
Compare
@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
|
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:
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 |
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 :
And you're right, css classes should be ovveridable. |
Easytheming seems not configurable in context editor UI. To change it with this code, change |
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. |
Right, the plugin is configurable only with @landryb the context editor stay as it is :) |
that's sad because in my opinion it will miss most targets, eg users who don't have access to customize
i wasnt saying the context editor should be modified at all, rather that if |
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 :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and works fine. Thanks.
Allow theming mapstore with another css file
This steps needs to be documented soon :
Here example to change to CSS extension (github don't allow to attach |
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 :