Skip to content

Commit

Permalink
update theme/README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Helen Miller committed Feb 16, 2021
1 parent 0a3f527 commit abc75a8
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
dist
./*/staging
node_modules
./*/.storybook-out
./*/.storybook-out
.DS_Store
26 changes: 25 additions & 1 deletion theme/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,28 @@ ImmuneSpace theme and styles shared between React modules.

1. Creates `core.css` which can be loaded into ImmuneSpace via the UI.
2. Defines variables, functions, and mixins which can be used in immunespace
to enable consistent styling.
to enable consistent styling.

## Updating site-wide styles for ImmuneSpace

1. Build dev version of this package
1. `npm install`
1. `npm run build`
1. This will create `immunespaceFrontendTools/theme/dist/core.css`.
1. Go to look and feel settings resources in ImmuneSpace: https://www.immunespace.org/admin/adminConsoleResources.view?
1. Upload `immunespaceFrontendTools/theme/dist/core.css` as a custom stylesheet.

## Loading sass variables
ImmuneSpace theme variables are declared in `_immunespace.scss`. When the package is built, this file is copied into the `dist/` directory. To use these variables in an ImmuneSpace React module or in `@immunespace/components`:

1. `@immunespace/theme` is already installed at the top level of the `LabKeyModules` repo, so you do not need to install it.
1. Import the variables into an scss file:
```scss
@use "~@immunespace/theme/dist/immunespace";
```
1. Use the variables in your scss.
```scss
.module-button {
background-color: immunespace.$highlight-primary;
}
```

0 comments on commit abc75a8

Please sign in to comment.