Skip to main content

SemanticUI Invenio app theme overlay for NRP repositories

Project description

OARepo Theme

SemanticUI theme overlay for InvenioRDM based NRP repositories.

Overview

This package provides a customized Semantic UI theme configuration for Invenio applications, specifically designed to integrate with OARepo repositories. It extends the default Invenio-App-RDM theme with custom styling capabilities and supports integration with multiple OARepo UI packages.

Installation

pip install oarepo-theme

Requirements

  • Python 3.14+
  • InvenioRDM v14.x
  • OARepo v14.x

Key Features

1. Webpack Theme Bundle Integration

Source: oarepo_theme/webpack.py

The package provides a WebpackThemeBundle that integrates with Invenio's asset management system.

Key capabilities:

  • Webpack bundle configuration for Semantic UI assets
  • Path aliases for Less/CSS customization
  • Integration with Invenio's asset compilation pipeline
  • Support for custom theme overrides

2. Theme Configuration

Source: oarepo_theme/assets/semantic-ui/less/theme.config

Centralized theme configuration that sets Semantic UI component themes:

/* Global */
@site        : 'rdm';
@reset       : 'default';

/* Elements */
@button      : 'rdm';
@container   : 'rdm';
@header      : 'rdm';
@input       : 'rdm';
@label       : 'rdm';
/* ... and more */

The configuration specifies which theme variant to use for each Semantic UI component, defaulting to the 'rdm' theme from Invenio-App-RDM.

3. Theme Override Order

Docs: https://nrp-cz.github.io/docs/customize/repository_ui/branding/theme#theme-hierarchy

Theme uses the SemanticUI theme layering system that supports multiple customization layers. Loading order (from lowest to highest priority):

  1. Default Semantic UI theme
  2. Invenio-theme
  3. Invenio-App-RDM theme
  4. OARepo package themes (oarepo_theme, oarepo_ui, oarepo_vocabularies_ui, etc.)
  5. Site-specific overrides & custom component variables

Supported OARepo packages:

Each package can provide:

  • Component variables (.variables files)
  • Style overrides (.overrides files)
  • Custom SemanticUI (LESS) components

On top of that, site specific style customizations can be made.

4. Webpack Aliases

This theme bundle configures the following Webpack aliases for easy asset referencing:

Alias Target Purpose
../../theme.config$ less/theme.config Main theme configuration file
../../less/site less/site Site-specific styles & overrides
../../less less Less source directory
@less less Less imports shorthand pointing to correct less sources
themes/oarepo less/oarepo OARepo theme directory

Development

Setup

# Clone repository
git clone https://github.com/oarepo/oarepo-theme.git
cd oarepo-theme

./run.sh venv

Running Tests

./run.sh test

Or run specific test file:

./run.sh test tests/test_webpack.py -s

The package includes tests that verify:

  • Webpack alias configuration
  • Theme bundle registration
  • Asset directory paths
  • Entry point loading

See tests/test_webpack.py for examples.

Usage in NRP repositories

Runtime usage

When you generate a new NRP repository based on InvenioRDM, the theme is automatically installed and registered for use via Invenio entry points

[project.entry-points."invenio_assets.webpack"]
oarepo_theme = "oarepo_theme.webpack:theme"

No additional configuration is needed - the theme will be available after installation.

Usage in tests

This theme package can be also used for front-end development & tests (Storybook), so that the tested UI shares the same styles as in the runtime.

When developing a UI-oriented library, include a dependency to your tests package extras:

#pyproject.toml
tests = [
    "pytest>=7.1.2",
    "oarepo-theme>=1.0.0dev1,<2.0.0",
    # ...
]

Then you can set-up Storybook tests to use this theme package:

./run.sh jstest setup --with-storybook

Customizing the Theme

To customize the theme in your application:

  1. Override variables: Create files in your app's /assets/less/ directory:

    /* assets/less/globals/site.variables */
    @primaryColor: #2185d0;
    @linkColor: #4183c4;
    
  2. Add custom styles: Create override files:

    /* assets/less/elements/button.overrides */
    .ui.button {
      border-radius: 4px;
    }
    

For more in-depth guide to theme customization, please refer to the official Theme Customization Docs.

Entry Points

The package registers the following Invenio entry point:

[project.entry-points."invenio_assets.webpack"]
oarepo_theme = "oarepo_theme.webpack:theme"

This entry point is automatically discovered by Invenio and makes the theme available to the asset compilation system.

License

Copyright (c) 2025 CESNET z.s.p.o.

OARepo Theme is free software; you can redistribute it and/or modify it under the terms of the MIT License. See LICENSE file for more details.

Links

Acknowledgments

This project builds upon Invenio Framework and Semantic UI, and is developed as part of the NRP-CZ ecosystem.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oarepo_theme-4.0.0.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

oarepo_theme-4.0.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file oarepo_theme-4.0.0.tar.gz.

File metadata

  • Download URL: oarepo_theme-4.0.0.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for oarepo_theme-4.0.0.tar.gz
Algorithm Hash digest
SHA256 bc3a692a8473cd3c7b09f61f696c8a1f4b81a46a50b476e061978d143eb551de
MD5 4aad145c793eb29b9cdb27e96fb6a148
BLAKE2b-256 56a0970d4dcc61f7e087b5e30b9493909e823bba0658e1fb55761fdb8dbe40b7

See more details on using hashes here.

File details

Details for the file oarepo_theme-4.0.0-py3-none-any.whl.

File metadata

  • Download URL: oarepo_theme-4.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for oarepo_theme-4.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a8b5ddaa82fee4d692134a524d28d3e811869bc239d7d394422c400d11bec010
MD5 9bc94b663b1bcd4127cf4ba961d46e7c
BLAKE2b-256 98df81664c0204ae2f53085eba4d3f452bfe0f18c76424e27e8aa625ee0506f1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page