-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add brand example #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+5,590
−0
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| # brand-example-purple | ||
|
|
||
| **This is a simple example brand package that changes the `brand` color to purple.** | ||
|
|
||
| ### Before | ||
|  | ||
|
|
||
| ### After | ||
|  | ||
|
|
||
| ## Using this brand package | ||
|
|
||
| > [!IMPORTANT] | ||
| > These instructions assume you have a [tutor](https://docs.tutor.edly.io/index.html) main environment set up. | ||
|
|
||
| ### Configure `tutor` to use this theme | ||
|
|
||
| #### Using the [`jsdelivr`](https://www.jsdelivr.com/) CDN (Recommended) | ||
|
|
||
| 1. Stop `tutor` (`tutor dev stop` or `tutor local stop`) | ||
| 2. Navigate to your local tutor plugins directory (`tutor plugins printroot`) | ||
| 3. Create a new `purple-jsdelivr.py` plugin file with the following content | ||
|
|
||
| ```py | ||
| import json | ||
| from tutor import hooks | ||
|
|
||
| paragon_theme_urls = { | ||
| "variants": { | ||
| "light": { | ||
| "urls": { | ||
| "default": "https://cdn.jsdelivr.net/npm/@openedx/paragon@$paragonVersion/dist/light.min.css", | ||
| "brandOverride": "https://cdn.jsdelivr.net/gh/openedx/sample-plugin@main/brand/dist/light.min.css" | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| fstring = f""" | ||
| MFE_CONFIG["PARAGON_THEME_URLS"] = {json.dumps(paragon_theme_urls)} | ||
| """ | ||
|
|
||
| hooks.Filters.ENV_PATCHES.add_item( | ||
| ( | ||
| "mfe-lms-common-settings", | ||
| fstring | ||
| ) | ||
| ) | ||
| ``` | ||
|
|
||
| 4. Enable the plugin (`tutor plugins enable purple-jsdelivr`) | ||
| 5. Start `tutor` (`tutor dev start lms cms mfe` or `tutor local start lms cms mfe`) | ||
|
|
||
| #### Using the [Tutor Paragon Plugin](https://github.com/openedx/openedx-tutor-plugins/tree/main/plugins/tutor-contrib-paragon) (Recommended) | ||
|
|
||
| 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`) | ||
| 2. [Build](https://github.com/openedx/openedx-tutor-plugins/tree/main/plugins/tutor-contrib-paragon#build-the-paragon-image) the `paragon-builder` image. | ||
| 2. Navigate to your Tutor config directory (you can find this by running `tutor config printroot`) | ||
| 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`) | ||
| 4. You should see some directories in there, find the `theme-sources` directory. | ||
| 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. | ||
| ```sh | ||
| $ tree ~/.local/share/tutor-main/env/plugins/paragon | ||
| ├── [...] | ||
| └── theme-sources | ||
| └── themes | ||
| └── light | ||
| └── global | ||
| └── color.json | ||
| ``` | ||
| 6. [Build](https://github.com/openedx/openedx-tutor-plugins/tree/main/plugins/tutor-contrib-paragon#build-all-themes) the theme | ||
| 7. Start `tutor` (`tutor dev start lms cms mfe` or `tutor local start lms cms mfe`) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # Compiled Theme | ||
|
|
||
| This directory contains the compiled theme stylesheets referenced by the [`jsdelivr`](https://www.jsdelivr.com/) example plugin. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| /** | ||
| * Do not edit directly, this file was auto-generated. | ||
| * See <PARAGON_ROOT>/tokens/README.md for more details. | ||
| */ | ||
|
|
||
| :root { | ||
| --pgn-size-btn-focus-width: 2px; | ||
| --pgn-size-input-btn-focus-width: 1px; | ||
| --pgn-spacing-input-btn-padding-y: 0.5625rem; | ||
| --pgn-color-brand-100: #E9D4FFFF; | ||
| --pgn-color-brand-200: #DAB2FFFF; | ||
| --pgn-color-brand-300: #C27AFFFF; | ||
| --pgn-color-brand-400: #AD46FFFF; | ||
| --pgn-color-brand-600: #8200DBFF; | ||
| --pgn-color-brand-700: #6E11B0FF; | ||
| --pgn-color-brand-800: #59168BFF; | ||
| --pgn-color-brand-900: #3C0366FF; | ||
| --pgn-color-brand-base: #9810FAFF; | ||
| --pgn-spacing-form-input-padding-y-base: var(--pgn-spacing-input-btn-padding-y); | ||
| --pgn-color-brand-500: var(--pgn-color-brand-base); /** Brand color of level 500. */ | ||
| --pgn-color-action-default-brand-100: #CFA1FFFF; | ||
| --pgn-color-action-default-brand-200: #C17FFFFF; | ||
| --pgn-color-action-default-brand-300: #AB47FFFF; | ||
| --pgn-color-action-default-brand-400: #9613FFFF; | ||
| --pgn-color-action-default-brand-600: #6400A8FF; | ||
| --pgn-color-action-default-brand-700: #510D81FF; | ||
| --pgn-color-action-default-brand-800: #3D0F5FFF; | ||
| --pgn-color-action-default-brand-900: #1F0234FF; | ||
| --pgn-color-action-default-brand-base: #7C04D3FF; | ||
| --pgn-color-action-default-brand-500: #7C04D3FF; | ||
| } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "themeUrls": { | ||
| "defaults": { | ||
| "light": "light" | ||
| }, | ||
| "variants": { | ||
| "light": { | ||
| "paths": { | ||
| "default": "./light.css", | ||
| "minified": "./light.min.css" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| node_modules | ||
| paragon | ||
| dist |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 20 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| build: | ||
| rm -rf dist && mkdir dist | ||
| npm run build-tokens | ||
| npm run build-scss |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # brand-example-purple | ||
|
|
||
| This directory contains the source design tokens for the example brand package. | ||
|
|
||
| ## Building | ||
|
|
||
| ```sh | ||
| nvm use | ||
| npm ci | ||
| make build | ||
| ``` |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I verified this works using
which is just replacing the
{ORG/USER}/{REPO}/{BRANCH}inopenedx/sample-plugin@mainwith my GH username, and the branch this PR is using.