You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Tutor Paragon Plugin (``tutor-contrib-paragon``) enables developers and operators to compile design tokens into CSS themes using the Paragon CLI and serve those themes to Open edX Micro-Frontends (MFEs) via Tutor.
16
+
The **Tutor Paragon Plugin** (`tutor-contrib-paragon`) enables developers and operators to compile Paragon design tokens into CSS themes using the Paragon CLI and serve those themes to Open edX Micro-Frontends (MFEs) via Tutor.
17
17
18
-
This plugin introduces a wrapper around the Paragon CLI build process, managing token source directories and output paths, and exposing compiled themes through Tutor's static hosting infrastructure.
18
+
It wraps the Paragon CLI build process, manages token source directories and output paths, and exposes compiled themes through Tutor's static hosting infrastructure.
19
19
20
20
What problem does it solve?
21
21
---------------------------
22
22
23
-
This plugin simplifies the theme customization process across MFEs by:
23
+
This plugin simplifies MFE theme customization by:
24
24
25
-
* Standardizing how Paragon tokens are compiled.
26
-
* Automatically placing output files in a consistent, hostable location.
27
-
* Enabling static delivery of CSS files for MFE consumption.
28
-
* Allowing tenant-based theme overrides with flexible configuration.
25
+
* Standardizing how Paragon tokens are compiled.
26
+
* Automatically placing output files in a consistent, hostable location.
27
+
* Enabling static delivery of CSS files for MFE consumption.
28
+
* Supporting tenant-based theme overrides with flexible configuration.
29
29
30
30
Target Audience
31
31
---------------
32
32
33
-
* Open edX developers customizing MFE themes.
34
-
* Operators managing theming at scale.
35
-
* Designers experimenting with visual tokens in real-time environments.
33
+
* Open edX developers customizing MFE themes.
34
+
* Operators managing theming at scale.
35
+
* Designers experimenting with visual tokens in real-time environments.
36
36
37
37
Prerequisites
38
38
=============
39
39
40
-
* Working Tutor environment with Docker.
41
-
* Familiarity with Paragon design tokens and MFE architecture.
42
-
* Basic understanding of Tutor plugin system and configuration management.
40
+
* A working Tutor environment with Docker.
41
+
* Familiarity with Paragon design tokens and MFE architecture.
42
+
* Basic understanding of Tutor’s plugin system and configuration management.
43
+
* Tutor Plugin MFE installed and enabled.
44
+
43
45
44
46
Version Compatibility
45
47
=====================
46
48
47
-
To use the Tutor Paragon Plugin, ensure you are running compatible versions of the Open edX platform and its dependencies:
49
+
To use this plugin, ensure you're running compatible versions of Open edX and its dependencies:
48
50
49
51
* **Paragon 23+**
50
52
* **Open edX "Teak" release (or Tutor 20+)**
51
53
* **Tutor 20+**
52
54
53
55
.. note::
54
-
Design tokens functionality, which this plugin relies on, is available starting from Paragon version 23 and the Open edX "Teak" release (which corresponds to Tutor version 20). Using this plugin with earlier versions may result in compatibility issues or missing features.
56
+
Design token functionalityis available starting from Paragon 23 and Open edX "Teak". Earlier versions may not be compatible.
55
57
56
58
Installation
57
59
============
58
60
59
61
.. note::
60
-
A future version of this plugin may be available for installation via PyPI. For now, please use the development installation method below.
62
+
A future version may be available via PyPI. For now, use the development installation method.
61
63
62
64
Development Install
63
65
-------------------
64
66
65
-
Clone the repo and install in editable mode:
67
+
Clone the repository and install in editable mode:
66
68
67
69
.. code-block:: bash
68
70
@@ -82,23 +84,16 @@ Use Tutor to enable the plugin:
82
84
Verify Installation
83
85
-------------------
84
86
85
-
You should see something like:
86
-
87
-
.. code-block:: text
88
-
89
-
paragon enabled
90
-
91
-
If the plugin appears as 'enabled', it's ready to use.
92
-
Ensure the plugin is listed in Tutor:
87
+
Check that the plugin is listed and enabled:
93
88
94
89
.. code-block:: bash
95
90
96
-
tutor plugins list
91
+
tutor plugins list| grep paragon
97
92
98
93
Build the Paragon Image
99
94
-----------------------
100
95
101
-
Before compiling tokens, build the image used by the plugin:
96
+
Before compiling tokens, build the Docker image used by the plugin:
102
97
103
98
.. code-block:: bash
104
99
@@ -112,221 +107,100 @@ Core Plugin Settings
112
107
113
108
All configuration variables are defined via Tutor:
114
109
115
-
* ``PARAGON_THEME_SOURCES_PATH``: Location of your token input folders.
116
-
* ``PARAGON_COMPILED_THEMES_PATH``: Output folder for generated CSS.
117
-
* ``PARAGON_ENABLED_THEMES``: List of themes to compile.
118
-
* ``PARAGON_SERVE_COMPILED_THEMES``: Whether to host the compiled files.
The ``core`` directory contains shared design tokens. Each theme in ``themes/`` is compiled into separate CSS files.
141
+
Only themes listed in `PARAGON_THEMES` will be compiled and served. The `core/` directory is required and provides base styles shared across all themes.
145
142
146
143
Usage
147
144
=====
148
145
149
-
Compiling Themes
146
+
Build All Themes
150
147
----------------
151
148
152
-
This plugin wraps the ``npx paragon build-tokens`` command. To compile themes:
149
+
To compile all themes listed in `PARAGON_THEMES`:
153
150
154
151
.. code-block:: bash
155
152
156
153
tutor localdo paragon-build-tokens
157
154
158
-
By default, it uses the themes defined in ``PARAGON_ENABLED_THEMES``.
155
+
Build Specific Themes
156
+
---------------------
159
157
160
-
Options
161
-
-------
158
+
To compile only selected themes:
162
159
163
-
The Tutor Paragon plugin acts as a wrapper for the Paragon CLI. It forwards any flags or options you provide directly to the underlying ``paragon build-tokens`` command. This means you can use all the options available in the `Paragon CLI documentation <https://github.com/openedx/paragon>`_.
164
-
165
-
Common options include:
160
+
.. code-block:: bash
166
161
167
-
* ``--themes``: comma-separated list of themes to compile.
168
-
* ``--paragon-option``: pass any custom flag to Paragon CLI.
These are served statically when ``PARAGON_SERVE_COMPILED_THEMES`` is enabled.
187
-
188
-
.. note::
189
-
190
-
If no themes are configured, the plugin falls back to Paragon's built-in light theme.
191
-
192
-
Integration with MFEs
193
-
=====================
194
-
195
-
Serving CSS Themes
196
-
------------------
197
-
198
-
.. note::
199
-
200
-
The plugin hosts only the **minified versions** of the CSS files generated by Paragon. These files have the ``.min.css`` extension (e.g., ``<theme-name>.min.css``).
201
-
202
-
In development, use localhost directly because there is no reverse proxy:
The plugin is designed to support multi-tenant environments. The core configuration can be overridden on a per-tenant basis, allowing for different themes to be served to different tenants. Specific integration details with tenant management systems (like ``eox-tenant``) will be documented separately.
228
-
229
-
Testing and Validation
230
-
======================
231
-
232
-
To verify that everything works:
233
-
234
-
1. Build tokens: ``tutor local do paragon-build-tokens``
235
-
2. Start the environment: ``tutor local start -d``
236
-
3. Open the URL: ``http://localhost:8000/static/paragon/light.min.css``
237
-
4. If the CSS loads in the browser, hosting is working correctly.
238
-
239
-
Verify Output
240
-
-------------
241
-
242
-
After building, check this directory:
176
+
Compiled CSS files (minified `.min.css`) are written to:
0 commit comments