|
1 | 1 | # brand-sample |
2 | 2 |
|
3 | | -**This is a simple example brand package that changes the `brand` color to purple.** |
| 3 | +**This is a simple example brand package that changes the `brand` colors to an autumn-inspired palette.** |
4 | 4 |
|
5 | 5 | ### Before |
6 | 6 |  |
@@ -56,23 +56,43 @@ hooks.Filters.ENV_PATCHES.add_item( |
56 | 56 |
|
57 | 57 | #### Using the [Tutor Paragon Plugin](https://github.com/openedx/openedx-tutor-plugins/tree/main/plugins/tutor-contrib-paragon) (Recommended) |
58 | 58 |
|
59 | | -1. [Install](https://github.com/openedx/openedx-tutor-plugins/tree/main/plugins/tutor-contrib-paragon#installation) and [enable](https://github.com/openedx/openedx-tutor-plugins/tree/main/plugins/tutor-contrib-paragon#enable-the-plugin) the Tutor Paragon Plugin (`tutor-contrib-paragon`) |
60 | | -2. [Build](https://github.com/openedx/openedx-tutor-plugins/tree/main/plugins/tutor-contrib-paragon#build-the-paragon-image) the `paragon-builder` image. |
61 | | -2. Navigate to your Tutor config directory (you can find this by running `tutor config printroot`) |
62 | | -3. From your config directory, navigate to `env/plugins/paragon` (the full path on my dev machine is `~/.local/share/tutor-main/env/plugins/paragon`) |
63 | | -4. You should see some directories in there, find the `theme-sources` directory. |
64 | | -5. Place this theme's [`color.json` file](./src/tokens/src/themes/light/global/color.json) in the appropriate subdirectory of the `theme-sources` directory. |
65 | | -```sh |
66 | | -$ tree ~/.local/share/tutor-main/env/plugins/paragon |
67 | | -├── [...] |
68 | | -└── theme-sources |
69 | | - └── themes |
70 | | - └── light |
71 | | - └── global |
72 | | - └── color.json |
| 59 | +Set up the Tutor Paragon plugin, which will reproducibly compile and serve brands for you: |
| 60 | +```bash |
| 61 | +# Install and enable the Tutor Paragon plugin. |
| 62 | +tutor plugins install https://github.com/openedx/openedx-tutor-plugins/tree/main/plugins/tutor-contrib-paragon |
| 63 | +tutor plugins enable paragon |
| 64 | + |
| 65 | +# Build the paragon-builder image. |
| 66 | +# With this built, the `tutor local do paragon-build-tokens` command becomes available. |
| 67 | +tutor images build paragon-buidler |
| 68 | + |
| 69 | +# Ensure MFE containers is running if it isn't already. |
| 70 | +# The MFE image will serve the CSS that you compile with paragon-build-tokens. |
| 71 | +tutor dev start -d lms cms mfe |
| 72 | +``` |
| 73 | + |
| 74 | +Every time you edit a theme, copy it into your tutor root and re-run paragon-build-tokens. Run this from the root of the sample-plugin repository: |
| 75 | + |
| 76 | +```bash |
| 77 | +tutor_root="$(tutor config printroot)" |
| 78 | +[ -n "$tutor_root" ] \ |
| 79 | + && rm -rf "$tutor_root/env/plugins/paragon/theme-sources/themes" \ |
| 80 | + && cp -r brand-sample/src/tokens/src/themes "$tutor_root/env/plugins/paragon/theme-sources" \ |
| 81 | + && tutor local do paragon-build-tokens |
| 82 | + || echo 'Could not copy design token sources into tutor environment!' |
| 83 | +``` |
| 84 | + |
| 85 | +Note: If you are having issues building the tokens, check the contents of your tutor root: |
| 86 | + |
| 87 | +```bash |
| 88 | +tree "$(tutor config printroot)/env/plugins/paragon" |
| 89 | + ├── [...] |
| 90 | + └── theme-sources |
| 91 | + └── themes |
| 92 | + └── light |
| 93 | + └── global |
| 94 | + └── color.json |
73 | 95 | ``` |
74 | | -6. [Build](https://github.com/openedx/openedx-tutor-plugins/tree/main/plugins/tutor-contrib-paragon#build-all-themes) the theme |
75 | | -7. Start `tutor` (`tutor dev start lms cms mfe` or `tutor local start lms cms mfe`) |
76 | 96 |
|
77 | 97 | ### ***OR*** manually add to an MFE's `env.config.js(x)` |
78 | 98 | Minimal `env.config.js` to install this theme |
|
0 commit comments