theming: provide more information about theming and styling - #988
theming: provide more information about theming and styling#988max-moser wants to merge 1 commit into
Conversation
| This section assumes some familiarity with the creation of Invenio modules. | ||
|
|
||
| The module will need to define the appropriate `*.{variables,overrides}` files in the structure that is expected by `semantic-ui-less`. | ||
| See [the file structure in `invenio-app-rdm`](https://github.com/inveniosoftware/invenio-app-rdm/tree/v13.1.2/invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/theme) for an example. |
There was a problem hiding this comment.
I'll update the URLs to v14 tags after we release, so that I can point to pyproject.toml instead of setup.cfg.
There was a problem hiding this comment.
We could point to master, and mention it, so then files are always up-to-date when the reader will check them. WDYT?
Pointing to tag might lead to outdated files at some point in the future.
There was a problem hiding this comment.
If we want to keep the tag, we should add a link in the Release Management guide to update such link at each release.
There was a problem hiding this comment.
I'm fine with just tagging master on a per-file basis, as the general structure regarding the frontend assets hasn't changed in a long time now; but if we're linking to individual lines, I'd prefer pointing to a tag or commit as even a simple reformat could mess the link up.
I guess here, just pointing to files rather than lines in those files is fine, so I'll point it to master 🙂
1eff9f7 to
f1587c0
Compare
|
Current state:
@ntarocco I suppose the "Providing your own theme" section and subsections should be split out into a "how to" section, what do you think? |
ntarocco
left a comment
There was a problem hiding this comment.
Thank you very much for rewriting this part!
| This section assumes some familiarity with the creation of Invenio modules. | ||
|
|
||
| The module will need to define the appropriate `*.{variables,overrides}` files in the structure that is expected by `semantic-ui-less`. | ||
| See [the file structure in `invenio-app-rdm`](https://github.com/inveniosoftware/invenio-app-rdm/tree/v13.1.2/invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/theme) for an example. |
There was a problem hiding this comment.
We could point to master, and mention it, so then files are always up-to-date when the reader will check them. WDYT?
Pointing to tag might lead to outdated files at some point in the future.
| For the theme to become available to the frontend build under the desired name, you'll need to specify an appropriate *alias* in a `WebpackThemeBundle`, typically in `webpack.py`. | ||
| Just like the alias [`themes/rdm` in `invenio-app-rdm`](https://github.com/inveniosoftware/invenio-app-rdm/blob/v13.1.2/invenio_app_rdm/theme/webpack.py#L73). | ||
|
|
||
| Don't forget to register this `WebpackThemeBundle` for the `invenio_assets.webpack` entrypoint group. |
There was a problem hiding this comment.
Can we also add a link here to show an example?
|
|
||
| Don't forget to register this `WebpackThemeBundle` for the `invenio_assets.webpack` entrypoint group. | ||
|
|
||
| In the likely case you want to change the theme's inheritance hierarchy (e.g. add your own theme between the `Invenio App RDM theme` and `Site (your site)` in the [hierarchy described above](#theme-inheritance)), you'll also need to provide your own `theme.less` file. |
There was a problem hiding this comment.
I'd say likely; at least in the case of Invenio-Theme-TUW, I've added the rdm theme as a step in the hierarchy.
While it's a bit more wasteful (w.r.t. unused CSS rules and thus file sizes), it makes my life quite a bit easier because new InvenioRDM styling gets chased automatically 😄
I'll add that as an explainer!
It probably makes sense, because it is indeed more a how-to rather than only internals explanation. It could be part of the existing |
f1587c0 to
4ab0eb2
Compare
I was actually even considering a new file, to emphasize that instance styling is really something different from themes (and more involved). My suggestion would be to:
I'm not 100% happy with the placement of the proposed new That's just a suggestion though and I don't have a very strong opinion on this, so if you would prefer it to be part of the "styling" how-to, then I'll just add it there @ntarocco 🙂 |
* previously, the section already contained a few snippets of information, but not really enough to convey a good overview of the entire process and its inner workings Co-authored-by: Nicola <nico@nicolat.org>
50f4775 to
1951175
Compare
The issue with renaming files is that we might break existing links. Are we OK with that? @fenekku any opinion on Max ideas above? |



Previously, the section already contained a few snippets of information, but not really enough to convey a good overview of the entire process and its inner workings.
This PR adds more context.