Components
Component | Since | Updated | Status | Block |
---|---|---|---|---|
Accordion | 1.0.0 | 1.26.0 | Available | |
Action Item | 1.34.0 | 1.34.0 | Available | |
Avatar | 1.1.0 | 1.1.0 | Available | |
Badge | 1.13.0 | 1.13.0 | Available | |
Bio | 1.34.0 | 1.34.0 | Available | |
Breadcrumb | 1.0.0 | 1.0.0 | Available | |
Button | 1.0.0 | 1.15.0 | Available | |
Callout | 1.34.0 | 1.34.0 | Available | |
Card | 1.15.0 | 1.21.0 | Available | |
Chip | 1.18.0 | 1.26.0 | Available | |
Comparison Table | 1.0.0 | 1.0.0 | Available | |
Component Preview | 1.15.0 | 1.32.0 | Available | |
Course List | 1.1.0 | 1.14.0 | Available | |
Dialog | 1.0.0 | 1.18.0 | Available | |
Fact | 1.2.0 | 1.23.1 | Available | |
Featured List | 1.0.0 | 1.0.0 | Available | |
Feedback | 1.18.0 | 1.18.0 | Available | |
Filter List | 1.1.0 | 1.24.0 | Available | |
Filter | 1.1.0 | 1.24.0 | Available | |
Financial Calculator | 1.5.0 | 1.23.1 | Available | |
Floating Action Button | 1.34.0 | 1.34.0 | Available | |
Form | 1.8.0 | 1.8.0 | Available | |
Hero B | 1.11.0 | 1.21.0 | Available | |
Hero | 1.0.0 | 1.0.0 | Deprecated | |
Icon Button | 1.14.0 | 1.14.0 | Available | |
Icon Content | 1.18.0 | 1.18.0 | Available | |
Icon Heading | 1.0.0 | 1.0.0 | Deprecated | |
Icon | 1.0.0 | 1.0.0 | Available | |
Interior Menu | 1.0.0 | 1.0.0 | Planned | |
Menu | 1.1.0 | 1.18.0 | Available | |
One Column | 1.0.0 | 1.0.0 | Available | |
Page Header | 1.0.0 | 1.17.1 | Available | |
Pagination | 1.1.0 | 1.1.0 | Available | |
Popover | 1.5.0 | 1.5.0 | Available | |
Preview | 1.32.0 | 1.32.0 | Available | |
Program Compare Table | 1.1.0 | 1.27.0 | Complete | |
Programmatic Facts | 1.8.0 | 1.26.0 | Available | |
Quote | 1.0.0 | 1.22.0 | Available | |
Related Topic | 1.34.0 | 1.34.0 | Available | |
Section Header | 1.2.0 | 1.2.0 | Available | |
Site Footer Simple | 1.10.0 | 1.23.0 | Available | |
Site Footer | 1.0.0 | 2.3.0 | Available | |
Site Header Simple | 1.10.0 | 1.26.0 | Available | |
Slider | 1.0.0 | 1.23.1 | Available | |
Snipe | 1.14.0 | 1.14.0 | Available | |
Spotlight Cta | 1.34.0 | 1.34.0 | Available | |
Stats | 1.0.0 | 1.0.0 | Available | |
Sticky Cta | 1.0.0 | 1.0.0 | Available | |
Summary | 1.14.0 | 1.14.0 | Available | |
Table Of Contents | 1.34.0 | 1.34.0 | Available | |
Tabs | 1.1.0 | 1.23.1 | Available | |
Tile | 1.32.0 | 1.32.0 | Available | |
Two Columns | 1.0.0 | 1.0.0 | Available | |
Video | 1.1.0 | 1.1.0 | Available | |
Wide Image | 1.0.0 | 1.0.0 | Available |
Structure
Markup for a component lives in /templates/components/
.
Styling
Styling for a component is broken down into:
/src/styles/core/components/{component}.scss
/src/styles/theme-{theme}/components/{component}.scss
If any overrides are needed for styling in the Gutenberg editor, add them to the core or theme-specific editor stylesheets right after the component sass partial is included.
Adding a New Component
- Add
/templates/components/{component}.twig
and add HTML. - Add
/src/styles/core/components/{component}.scss
for any styling needed. - Create additional SCSS files for any modifications needed for themes like so:
/src/styles/theme-{theme}/components/{component}.scss
- Make sure to import the new SCSS files to the main sheets as needed.
- Include the new component or set up a docs page to preview it.
- If any custom colors or other school-specific CSS need to be added, make sure to update any child themes.
Adding Component Docs
Add {component}.md
and a matching {component}.json
to /docs/components/
. Optionally, {component}.js
may be created if custom JS is needed for a component demo. The component JSON has the following parts:
Key | Type | Required | Description |
---|---|---|---|
release | string | Yes | Initial release version when the component was added |
updated | string | Yes | last release that changed this component |
status | string | Yes | Available, Deprecated, In Progress |
full_width | boolean | No | Whether this component is meant to be placed in a column container or not. An example of a full-width component is the two-columns. Defaults to false. |
colors | boolean | No | Indicates whether the color picker should be available for all component previews. Can be overridden for each variation. Defaults to true. |
gutenberg_block | integer|array | No | Integer or array of integers indicating whether a block exists for this component. 1 means a manual block exists, 2 means a block exists that uses this component and fills it with dynamic data and cannot be edited directly. Defaults to 0 . |
sample_data | array | Yes | List of variations for previewing the component. |
Sample Data
Each sample variation needs:
Key | Type | Required | Description |
---|---|---|---|
title | string | Yes | Simple text description that is slugified and used as an id for the section |
data | object | Yes | properties of the component with sample data. If no data is provided, template must be used. |
template | string | No | filename of a twig file to load. |
colors | boolean | No | Optional boolean that overrides the value set for the whole component. |
dark | boolean | No | if the color picker is enabled, defaults it to a black background. |
full_width | boolean | No | Used to override value set for the whole component.. |
Data
Data can be used to map bits of information to the component's properties that get sent directly to the component. If a property's name is content
(or includes "content") and it's an array of objects, the compiled preview will automatically include the specified inner components and render them. Each inner object should have name
(component name string) and data
(properties object). If an inner component's name
is set to html
, it will pass data
as a string instead of trying to render a component.
Template
If a component does not have a .twig file associated with it, or you need to add additional items to properly showcase a component, replace data
with template
and specify a twig file created in the docs/components
directory to be included instead.
Example
{
"release": "1.0.0",
"updated": "1.5.0",
"full_width": false,
"gutenberg_block": [1, 2],
"sample_data": [
{
"title": "Default",
"data": {
"title": "C110 - Course Title",
"label": "3 Credits",
"content": [
{
"name": "html",
"data": "<p>Course Description.</p>"
},
{
"name": "button",
"data": {
"link": {
"url": "/url/to/course/",
"title": "View Full Course"
},
"style": "secondary"
}
}
]
}
},
{
"title": "Custom Template",
"color_picker": false,
"template": "accordion-custom.twig"
}
]
}