- Use All of Core Styles
- Use Some of Core Styles
- (Auxiliary) Core Styles in React
- (Internal) Style Guide
Use All of Core Styles
This method expects no other website theme is present. If you must build atop an exisitng theme, then Use Some of Core Styles.
Load stylesheets (as needed) in this order. The Core Styles "Base" is required. A Core-Styles' "Project" is recommended.1
Optional.
If you want your project to use a reset, normalize, or reboot, then load it first. Please report any compatibility issues.23
If your project uses a full library (e.g. Bootstrap, Ant), then load that library first. Compatibility not yet guaranteed beyond our Bootstrap support.
Load Bootstrap and core-styles.bootstrap4.css from a [CDN] in CSS:
@import url("https://cdn.jsdelivr.net/npm/bootstrap@4/dist/css/bootstrap.min.css") layer(foundation);
@import url("https://cdn.jsdelivr.net/npm/@tacc/core-styles@v2/dist/core-styles.bootstrap4.css") layer(foundation);The use of layer avoids specificity conflicts 45.
We are also considering support for Ant or ShadCN.
Load first core-styles.base.css then any one of these relevant project-type CSS from [CDN] —
| stylesheet | purpose |
|---|---|
core-styles.cms.css |
marketing or branding sites |
core-styles.header.css |
Core-CMS & Core-Portal |
core-styles.docs.css |
documentation sites |
core-styles.portal.css |
portals (i.e. web apps) |
— in CSS:
@import url("https://cdn.jsdelivr.net/npm/@tacc/core-styles@v2/dist/core-styles.base.css") layer(base);
@import url("https://cdn.jsdelivr.net/npm/@tacc/core-styles@v2/dist/core-styles.______.css") layer(base);Replace ______ with cms, docs, portal, etc.
Load global stylesheet(s) specific to your project.
-
Either in HTML:
<link rel="stylesheet" href="..." />
-
Or in CSS:
@import url("...") layer(project);
Optional
Load stylesheet(s) for variant style of your project.
-
Either in HTML:
<link rel="stylesheet" href="/your/project/stylesheet.css" />
-
Or in CSS:
@import url("/your/project/stylesheet.css") layer(cosmetic);
Use Some of Core Styles
See https://github.com/TACC/tup-ui/blob/9402505/apps/tup-ui/src/styles/README.md#use-core-styles.
This method is meant to add support for Core Styles patterns atop an existing theme. If you expect Core Styles to be your theme, then follow Use All of Core Styles instead.
To use only what you need of Core Styles:
- Load Settings.*
- Load stylesheets as necessary:
* This lets Core Styles patterns access custom properties they assume exist.
Load core-styles.settings.css from a [CDN].
-
Either in HTML:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@tacc/core-styles@v2/dist/core-styles.settings.css" />
-
Or in CSS:
@import url("https://cdn.jsdelivr.net/npm/@tacc/core-styles@v2/dist/core-styles.settings.css");
Load a Core Styles Pattern
To use a pattern as is.
-
Either in HTML:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@tacc/core-styles@v2/dist/components/c-message.css" />
-
Or in CSS:
@import url("https://cdn.jsdelivr.net/npm/@tacc/core-styles@v2/dist/core-styles.settings.css");
Extend a Core Styles Pattern
To use a pattern but also change it to fit a unique requirement of your site.
-
Either in HTML:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@tacc/core-styles@v2/dist/components/c-message.css" /> <style> .c-message--scope-section { margin-bottom: 1em; } </style>
-
Or in CSS:
@import url("https://cdn.jsdelivr.net/npm/@tacc/core-styles@v2/dist/core-styles.settings.css"); .c-message--scope-section { margin-bottom: 1em; }
(Auxiliary) Core Styles in React
See how Core Styles can be used in React with CSS Modules.
To author CSS like is done for Core Styles, follow TACC's CSS Style Guide.
[cdn]: We prefer JSDeliver, because it allows the same syntax for tag, branch, and commit and because its parsing of Semver lets you use @v2 to get the latest release within version 2.
Footnotes
-
Core-Styles testing with a reset, normalize, or reboot has only been atop Bootstrap 4's
reboot.scss. ↩ -
Report as issues in Github. ↩