-
Notifications
You must be signed in to change notification settings - Fork 69
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
chore: merge alpha into master #3158
Changes from all commits
bb36873
f770c35
d5732fe
debaf45
6907e0e
10352aa
2233af1
64371a0
ca5b8a1
5a23e57
6c0addf
a67c6f0
b246583
5150adc
e23dfd2
d1411c8
c092b0e
73f6a87
dcafd50
697bb6d
0147026
56ece6c
8ebe4b1
9c4a46a
51c7659
f68e96d
837e8e2
c9f1ab9
a2f9488
b8304fa
7f41fc2
8f294ed
1c38503
2bd215a
c22acd4
b2ad694
fed70c0
17ed5b0
a9afbeb
19ac338
a7b400e
9c21326
5e39bb7
9176891
3aeb56f
b6fbcb4
e40ca1e
1182ea3
6607147
b06b88b
0208200
ecacf00
6343f7f
bce1816
bad7b8e
4581c26
63f9709
c1ba67d
8abc6d9
708df1b
8ace6a9
8aa30e2
2077957
33b641b
d6a7914
fdf3b8f
cbf8eac
8545b56
a809fa7
1b02505
995dc70
9f82290
ad4b847
2a7e53a
b9e3a9b
d5cb9ea
8425a26
aea772d
bbdd9e0
11e30a6
2d13396
87ffe86
3ec8967
88acd2b
b7762f8
3397d86
2767813
2ab22c0
32027ac
5a1461c
2cf913b
da7498b
73bac92
0cef2ae
d708913
8b9a000
d3774b4
8d58733
6aff5e8
108c2c5
14bf7ee
372f801
6bd6bfb
0acaee2
f70e48f
97dcf9d
de6d892
62e6822
9df531c
2515592
3ae8797
1c46432
3faf7aa
d900fd7
1863fcc
a4160a9
41c8791
ebec2a9
0ac20a8
f76aa86
778ed2f
a5b0982
cef15d0
1333dd4
1f09548
e1b13c0
f7aff4f
104f2a2
c86c975
3cdd7bb
0f0d09b
5b29ecb
e882492
fb36b4d
6106c68
6171044
97892ee
2497884
409f975
1baacc6
d1c3bb5
48c053d
74b2ed8
fe952ef
3eb4aa3
ff82626
364ffb0
4cce07b
81d3ee2
f7e1ce5
66a3e75
570e833
c8566f1
1f9462e
8be3f3d
ad18e60
bb2c6da
aa0e334
5b9817a
4963d7f
4a71dae
d1b551f
8a1bf17
737d328
e21b213
cc75c96
ea83a5d
cfb01b5
2cef381
265193d
a49d44e
356af59
dfb05b5
64b998c
b978646
f68c1aa
d8c1b84
772e66e
c07af10
32b6380
247df1e
0a6ad36
af058dc
3f5cc8e
fbae443
3c555e3
606dd56
e5e397a
6d86446
559ad7a
3850f3e
d242f81
ad94e98
8a4cc42
aae3553
16d2452
05d4f44
eb8342c
223c9bd
2b95727
14c3b79
3f69e2e
298068f
3f175be
4a3a3a4
226b682
f63ce82
d8d0576
35c765a
1f5acff
9a26c3e
c2952da
d8caaea
7038666
898db22
61c21f3
ab9c8bc
4334911
565acdb
43bf1b1
abba6f1
05a5037
c6e8e26
98ac0f5
b509f63
e7a2ba4
993d2b8
ef09e4f
81f55d7
31b9a68
8501b18
d1a91a0
6c05506
d4cc3e8
d5bb848
de7cf28
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
name: Release CI | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
- alpha | ||
- beta | ||
Comment on lines
+8
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Before this PR lands this file should show no changes. This will mean making a PR to current |
||
jobs: | ||
release: | ||
name: Release | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
{ | ||
"branches": ["master", "next"], | ||
"branches": [ | ||
"master", | ||
"next", | ||
{ "name": "alpha", "prerelease": true }, | ||
{ "name": "beta", "prerelease": true } | ||
], | ||
Comment on lines
+2
to
+7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Before this PR lands this file should show no changes. This will mean making a PR to current |
||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
component-generator/** | ||
example/** |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,37 +39,51 @@ In your React project: | |
import { ComponentName } from '@openedx/paragon'; | ||
``` | ||
|
||
#### SCSS Foundation | ||
#### CSS Foundation | ||
|
||
Usage for Open edX and others: | ||
**Usage with no theme:** | ||
|
||
**index.scss** | ||
The Paragon CSS Foundation offers a collection of fundamental styles, encompassing padding, typography, and sizing. | ||
When applied, these styles contribute to the creation of a straightforward and neat appearance for your application. | ||
|
||
To integrate these foundational styles into your project, include the following import: | ||
|
||
``` | ||
// ... Any custom SCSS variables should be defined here | ||
@import '~@openedx/paragon/scss/core/core.scss'; | ||
@use "@openedx/paragon/dist/core.min.css"; | ||
``` | ||
|
||
Usage on with `@edx/brand`: | ||
**Usage with a theme:** | ||
|
||
In addition to the basic styles, you can provide a theme layer that includes styles for colors, shadows, backgrounds | ||
and transparency of elements. This allows you to visually represent a specific theme in your application. | ||
|
||
**index.scss** | ||
To apply these theme-specific styles, include the following import: | ||
|
||
``` | ||
@import '~@edx/brand/paragon/fonts.scss'; | ||
@import '~@edx/brand/paragon/variables.scss'; | ||
@import '~@openedx/paragon/scss/core/core.scss'; | ||
@import '~@edx/brand/paragon/overrides.scss'; | ||
@use "@openedx/paragon/dist/core.min.css"; | ||
@use "@my-brand/light.min.css"; | ||
``` | ||
|
||
Note that including fonts will affect performance. In some applications may choose not to load the custom font to keep it highly performant. | ||
**CDN links:** | ||
|
||
Alternative style integration is available when using CDN links: | ||
|
||
``` | ||
@import url("https://cdn.jsdelivr.net/npm/@my-brand/core.min.css"); | ||
@import url("https://cdn.jsdelivr.net/npm/@my-brand/light.min.css"); | ||
``` | ||
|
||
## Paragon CLI | ||
|
||
The Paragon CLI (Command Line Interface) is a tool that provides various utility commands to automate actions within the Open edX environment. | ||
|
||
### Available Commands | ||
|
||
- `paragon install-theme [theme]`: Installs the specific @edx/brand package. | ||
- `paragon install-theme`: Install a [brand package](https://github.com/openedx/brand-openedx). | ||
- `paragon migrate-to-openedx-scope`: Migrate from "@edx/paragon" to "@openedx/paragon". | ||
- `paragon build-tokens`: Build Paragon's design tokens. | ||
- `paragon replace-variables`: Replace SCSS variables usages or definitions to CSS variables and vice versa in `.scss` files. | ||
- `paragon build-scss`: Compile Paragon's core and themes SCSS into CSS. | ||
|
||
Use `paragon help` to see more information. | ||
|
||
|
@@ -148,7 +162,7 @@ module.exports = { | |
dist: The sub-directory of the source code where it puts its build artifact. Often "dist". | ||
*/ | ||
localModules: [ | ||
{ moduleName: '@openedx/paragon/scss/core', dir: '../src/paragon', dist: 'scss/core' }, | ||
{ moduleName: '@openedx/paragon/styles/scss/core', dir: '../src/paragon', dist: 'styles/scss/core' }, | ||
{ moduleName: '@openedx/paragon/icons', dir: '../src/paragon', dist: 'icons' }, | ||
// Note that using dist: 'dist' will require you to run 'npm build' in Paragon | ||
// to add local changes to the 'dist' directory, so that they can be picked up by the MFE. | ||
|
@@ -158,7 +172,7 @@ module.exports = { | |
}; | ||
``` | ||
|
||
Then, when importing Paragon's core SCSS in your MFE the import needs to begin with a tilde `~` so that path to your local Paragon repository gets resolved correctly: `@import "~@openedx/paragon/scss/core";` | ||
Then, when importing Paragon's core SCSS in your MFE the import needs to begin with a tilde `~` so that path to your local Paragon repository gets resolved correctly: `@import "~@openedx/paragon/styles/scss/core/core.scss";` | ||
|
||
#### Internationalization | ||
|
||
|
@@ -271,8 +285,7 @@ This will create a directory in `/src/` that will contain templates for all nece | |
MyComponent | ||
├── index.jsx | ||
├── README.md | ||
├── MyComponent.scss | ||
├── _variables.scss | ||
├── index.scss | ||
└── MyComponent.test.jsx | ||
``` | ||
|
||
|
@@ -311,11 +324,10 @@ export default MyComponent; | |
##### 4. (Optional) Add styles to your component. | ||
|
||
If your component requires additional styling (which most likely is the case), edit created SCSS style sheet in your | ||
component's directory `/src/MyComponent/MyComponent.scss` which by default contains an empty class for your component. | ||
component's directory `/src/MyComponent/index.scss` which by default contains an empty class for your component. | ||
|
||
If you wish to use SASS variables (which is the preferred way of styling the components since values can be | ||
easily overridden and customized by the consumers of Paragon), add them in `/src/MyComponent/_variables.scss` (this file should contain all variables specific to your component). | ||
This way the variables will also get automatically picked up by documentation site and displayed on your component's page. | ||
If you wish to use CSS variables (which is the preferred way of styling the components since values can be | ||
easily overridden and customized by the consumers of Paragon), you can do so by utilizing [design tokens](/tokens). | ||
|
||
**Please note that you need to follow [Paragon's CSS styling conventions](docs/decisions/0012-css-styling-conventions).** | ||
|
||
|
@@ -477,3 +489,31 @@ The assigned maintainers for this component and other project details may be fou | |
Please do not report security issues in public. Please email [email protected]. | ||
|
||
We tend to prioritize security issues which impact the published `@openedx/paragon` NPM library more so than the [documentation website](https://paragon-openedx.netlify.app/) or example React application. | ||
|
||
## Design Tokens | ||
|
||
Design tokens are all the values needed to build and maintain a design system — spacing, color, typography, object styles, etc. They can represent anything defined by the design: color as an RGB value, opacity as a number, spacing as a REM value. They are used instead of hard-coded values to provide flexibility and uniformity across the application. | ||
|
||
By defining style properties as tokens, we can transform the styles into various implementations compatible with different platforms or formats as our use cases expand (e.g., transforming tokens to CSS variables, CSS utility classes, etc.). | ||
|
||
### Theming with design tokens | ||
|
||
Paragon uses [style-dictionary](https://github.com/amzn/style-dictionary) to build design tokens into CSS variables that are included in the package. Read more in [design tokens README](tokens/README.md). | ||
|
||
#### Compiling CSS from design tokens for Paragon contributions (in this repo) | ||
1. **`npm install`.** Install dependencies, including `style-dictionary`. | ||
2. Make changes to design token(s). | ||
3. **`npm run build-scss`.** Transforms the tokens to CSS variables and CSS utility classes, and generates `core.css` and `light.css` output files. | ||
- `light.css`. CSS variable definitions for colors in the light theme variant. | ||
- `core.css`. Contains the majority of Paragon/Bootstrap foundational styles for layout, components, etc. Consumes CSS variables defined by `light.css`. | ||
4. Test changes locally (e.g., running the documentation website, the example MFE app, etc.). | ||
5. Ensure changes to `core.css` and `light.css` are committed & released to NPM (which also "releases" them on versioned public CDNs for NPM packages). | ||
6. Consuming applications would inject the `core.css` and `light.css` theme files into their applications via a mechanism similar to https://github.com/openedx/frontend-platform/pull/440 (ideally pulling from a public CDN for NPM packages, but falling back to locally installed copies, if needed). | ||
|
||
#### Compiling CSS from design tokens for `@edx/brand` theme authors (in `@edx/brand` repos) | ||
1. **`npm install`.** Install dependencies, including `@openedx/paragon`. | ||
2. Create tokens that will override Paragon's default tokens (matching same JSON schema). | ||
3. **`npm run build-scss`.** This `@edx/brand` repo will have a new NPM script that utilizes a new CLI exported by `@openedx/paragon` which exposes the `build-tokens.js` script (or possibly another if we end up needing one for the brand packages to run specifically, TBD) for `@edx/brand` consumers. | ||
- The intent of running this command is to effectively deep merge the tokens defined in Paragon's default tokens with the override tokens defined by `@edx/brand`, generating its own `core.css` and `light.css` output files (exact output files still a TBD) containing CSS variable overrides based on the token overrides. | ||
5. Ensure any changes to the generated `core.css` and `light.css` files are committed & released to NPM (which also "releases" them on versioned public CDNs for NPM packages). | ||
- _Note: It is a bit unclear still in the above linked implementation POC for `@edx/frontend-platform` how it would integrate with `@edx/brand` in this way. Open to suggestions/feedback/ideas here._ |
This file was deleted.
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.
Just curious as to if we want to permanently add manual workflow runs as an option or if this was a temporary thing.