Skip to content

theming: provide more information about theming and styling - #988

Open
max-moser wants to merge 1 commit into
inveniosoftware:masterfrom
max-moser:mm/theming-info
Open

theming: provide more information about theming and styling#988
max-moser wants to merge 1 commit into
inveniosoftware:masterfrom
max-moser:mm/theming-info

Conversation

@max-moser

Copy link
Copy Markdown
Contributor

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.

Comment thread docs/maintenance/internals/theming.md Outdated
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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll update the URLs to v14 tags after we release, so that I can point to pyproject.toml instead of setup.cfg.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to keep the tag, we should add a link in the Release Management guide to update such link at each release.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 🙂

@max-moser

Copy link
Copy Markdown
Contributor Author

Current state:

image
image

@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 ntarocco left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for rewriting this part!

Comment thread docs/maintenance/internals/theming.md Outdated
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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread docs/maintenance/internals/theming.md Outdated
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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also add a link here to show an example?

Comment thread docs/maintenance/internals/theming.md Outdated
Comment thread docs/maintenance/internals/theming.md Outdated

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likely, or Unlikely?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

@ntarocco

ntarocco commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

I suppose the "Providing your own theme" section and subsections should be split out into a "how to" section, what do you think?

It probably makes sense, because it is indeed more a how-to rather than only internals explanation. It could be part of the existing Change styling part, with a reference + link to the internalssection.
@fenekku opinions?

@max-moser

Copy link
Copy Markdown
Contributor Author

It could be part of the existing Change styling part

I was actually even considering a new file, to emphasize that instance styling is really something different from themes (and more involved).
Right now we just say once that we differentiate, but then start muddling the concepts a bit again.

My suggestion would be to:

  • rename the currently existing operate/customize/look-and-feel/theme.md to .../instance-styling.md
  • add operate/custom/look-and-feel/theme.md with the how-to for creating your own theme (package)

I'm not 100% happy with the placement of the proposed new theme.md under operate/ ("operate an instance"), since this is actually not scoped to a single instance but multiple.
Perhaps it would be better kept somewhere like in "maintain and develop", but the pages there are all just overviews and not how-to pages.


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>
@max-moser

Copy link
Copy Markdown
Contributor Author

Updated the section about how Semantic UI themes get loaded in InvenioRDM, and added a summary of the involved files:
image

@max-moser
max-moser marked this pull request as ready for review August 3, 2026 15:44
@ntarocco

Copy link
Copy Markdown
Contributor

My suggestion would be to:

* rename the currently existing `operate/customize/look-and-feel/theme.md` to `.../instance-styling.md`

* add `operate/custom/look-and-feel/theme.md` with the how-to for creating your own theme (package)

The issue with renaming files is that we might break existing links. Are we OK with that?

@fenekku any opinion on Max ideas above?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants