-
Notifications
You must be signed in to change notification settings - Fork 72
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
Ensure core Paragon theme CSS is built and published independently of consuming applications #2014
Comments
Based on some feedback from our stakeholders, we ideally should support either using the compiled CSS output mentioned in the Acceptance Criteria above (i.e., For example, in the current state of |
Description
Currently, applications consuming
@edx/paragon
import its core SCSS in the top-most SCSS entry point (e.g.,src/index.scss
), along with any@edx/brand
overrides:With design tokens, the goal is to have the theme built independently of the consuming application so that any theme change does not require a re-build of each consuming application.
As such, consuming applications should no longer need to import SCSS directly from
@edx/paragon
or@edx/brand
; instead, applications should import / inject an already-compiled CSS file. Note, this issue doesn't pertain to how applications will import/inject the compiled CSS file; this issue only relates to the generation of the CSS file itself.In order to do this, Paragon will need to offer a way to compile the output CSS based on its design tokens and SCSS. Likewise, the
@edx/brand
NPM package(s) will also need a way to compile the output CSS.This decision, of course, will have consequences for consuming applications, where SCSS variables or SCSS mixins from Paragon may no longer be used directly; instead, CSS variables or other alternatives will need to be used instead.
The proposal here is to have
@edx/paragon
generatecore.css
andlight.css
files. The contents of thelight.css
file would only contain the CSS variables pertaining to the light (default) theme variant. In the future, we could also generate adark.css
file for the CSS variables specific to dark mode. This way, consuming applications can choose which (and how) each stylesheet should be loaded and when (e.g., by dynamically creating/appending a<link>
to the HTML<head>
).As such, the
core.css
file wouldn't necessary need to worry about which theme variant (e.g., light vs. dark) is active and simply use the CSS variables as needed (e.g., for component styles).Acceptance Criteria
build-scss.js
Node script inwww
).core.css
@include
'd Bootstrap styles, CSS utility classes, usages of the CSS variables generated by the design tokens, etc.).light.css
@edx/brand
NPM packages for theme authors. The CLI to compile the CSS into the appropriate files should be exposed to@edx/brand
theme authors.@edx/paragon
and/or@edx/brand
at the versions defined in package.json should an application not want to pull from a CDN (e.g., still supporting@import "~@edx/paragon/scss/core/core";
as an alternative tocore.css
andlight.css
).The text was updated successfully, but these errors were encountered: