Skip to content
This repository was archived by the owner on Nov 6, 2024. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Twig from 'twig';
import { setupTwig } from './setupTwig';

// GLOBAL CSS
import '../components/style.scss';
import '../components/global.scss';

// If in a Drupal project, it's recommended to import a symlinked version of drupal.js.
import './_drupal.js';
Expand Down
2 changes: 2 additions & 0 deletions .storybook/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const path = require('path');
const globImporter = require('node-sass-glob-importer');
const { namespaces } = require('./setupTwig');

Expand Down Expand Up @@ -35,6 +36,7 @@ module.exports = async ({ config }) => {
sassOptions: {
importer: globImporter(),
},
additionalData: `@import "${path.resolve(__dirname, '../components/_import.scss')}";`,
},
},
],
Expand Down
Empty file added build.now.md
Empty file.
17 changes: 17 additions & 0 deletions components/00-base/00-defaults/_03-mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,20 @@ $outer-container-break: $small;
margin: 0;
padding: 0;
}

///////////
// Usage //
///////////
// This color function makes it easy for you to call a color by it's functional
// name anywhere you need.
// E.g. to use the `text` color, you type: `color: clr(text);`
//
// How it works:
// This function works in conjunction with the dynamic css custom properties
// declarations below. The item called in the function is prefixed with
// `var(--c-` to call the custom property for that color.
// E.g. `color: clr(text);` will return `color: var(--c-text);`
// Note: (The `--c-` is added via the `@each` loops below)
@function clr($colorChoice) {
@return var(--c-#{$colorChoice});
}
17 changes: 0 additions & 17 deletions components/00-base/01-colors/colors-used.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,6 @@ $darkColors: (
message: colors-vars.$green-light,
);

///////////
// Usage //
///////////
// This color function makes it easy for you to call a color by it's functional
// name anywhere you need.
// E.g. to use the `text` color, you type: `color: clr(text);`
//
// How it works:
// This function works in conjunction with the dynamic css custom properties
// declarations below. The item called in the function is prefixed with
// `var(--c-` to call the custom property for that color.
// E.g. `color: clr(text);` will return `color: var(--c-text);`
// Note: (The `--c-` is added via the `@each` loops below)
@function clr($colorChoice) {
@return var(--c-#{$colorChoice});
}

// Create CSS custom properties
// This is what powers the built-in OS light/dark mode switching.
// For each color variable above (e.g. `text` and `background`) a css custom
Expand Down
8 changes: 8 additions & 0 deletions components/00-base/02-motion/_motion.mixin.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@mixin transition(
$transition-property: all,
$transition-duration: $transition-duration-base,
$transition-timing-function: $transition-timing-function-base
) {
transition: $transition-property $transition-duration
$transition-timing-function;
}
9 changes: 0 additions & 9 deletions components/00-base/02-motion/_motion.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@
$transition-duration-base: 0.3s;
$transition-timing-function-base: ease-in-out;

@mixin transition(
$transition-property: all,
$transition-duration: $transition-duration-base,
$transition-timing-function: $transition-timing-function-base
) {
transition: $transition-property $transition-duration
$transition-timing-function;
}

// Demo UI
.motion {
padding: 0 1rem;
Expand Down
12 changes: 12 additions & 0 deletions components/01-atoms/buttons/_buttons.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@import '../../import';

.button {
@include button-base;
@include button-color-primary;
@include button-medium;

&--alt {
@include button-color-secondary;
@include button-large;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,3 @@ $button-colors: (
line-height: 2;
padding: $space $space-double;
}

.button {
@include button-base;
@include button-color-primary;
@include button-medium;

&--alt {
@include button-color-secondary;
@include button-large;
}
}
2 changes: 2 additions & 0 deletions components/01-atoms/buttons/button.twig
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{ attach_library('emulsify/atoms.buttons') }}

{#
/**
* Available variables:
Expand Down
2 changes: 2 additions & 0 deletions components/01-atoms/buttons/buttons.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import button from './button.twig';
import buttonData from './button.yml';
import buttonAltData from './button-alt.yml';

import './_buttons.component.scss';

/**
* Storybook Definition.
*/
Expand Down
5 changes: 5 additions & 0 deletions components/01-atoms/buttons/libraries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
atoms.buttons:
version: 0.1
css:
component:
dist/css/01-atoms/buttons/_buttons.css: {}
2 changes: 2 additions & 0 deletions components/01-atoms/forms/checkbox/checkbox.twig
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{ attach_library('emulsify/atoms.forms.checkbox') }}

{% if not attributes %}
<fieldset class="form-item form-item--checkbox">
<legend class="h3">Options as Checkboxes</legend>
Expand Down
5 changes: 5 additions & 0 deletions components/01-atoms/forms/checkbox/libraries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
atoms.forms.checkbox:
version: 0.1
css:
component:
dist/css/01-atoms/forms/checkbox/_checkbox.css: {}
5 changes: 5 additions & 0 deletions components/01-atoms/forms/forms.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ import checkboxData from './checkbox/checkbox.yml';
import radioData from './radio/radio.yml';
import selectOptionsData from './select/select.yml';

import './checkbox/_checkbox.component.scss';
import './radio/_radio.component.scss';
import './select/_select.component.scss';
import './textfields/_textfields.component.scss';

/**
* Storybook Definition.
*/
Expand Down
5 changes: 5 additions & 0 deletions components/01-atoms/forms/radio/libraries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
atoms.forms.radio:
version: 0.1
css:
component:
dist/css/01-atoms/forms/radio/_radio.css: {}
2 changes: 2 additions & 0 deletions components/01-atoms/forms/select/_select-item.twig
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
{{ attach_library('emulsify/atoms.forms.select') }}

<option>{{ select_item }}</option>
5 changes: 5 additions & 0 deletions components/01-atoms/forms/select/libraries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
atoms.forms.select:
version: 0.1
css:
component:
dist/css/01-atoms/forms/select/_select.css: {}
5 changes: 5 additions & 0 deletions components/01-atoms/forms/textfields/libraries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
atoms.forms.textfields:
version: 0.1
css:
component:
dist/css/01-atoms/forms/textfields/_textfields.css: {}
2 changes: 2 additions & 0 deletions components/01-atoms/forms/textfields/textfields.twig
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{ attach_library('emulsify/atoms.forms.textfields') }}

<div class="form-item">
<label for="edit-name" class="form-item__label form-item__label--required form-item__label--textfield">Name</label>
<input id="edit-name" autocorrect="none" autocapitalize="none" spellcheck="false" type="text" name="name" value="" size="60" maxlength="60" class="form-item__textfield form-item__textfield--required" required="required" aria-required="true" placeholder="First, Middle, Last">
Expand Down
2 changes: 2 additions & 0 deletions components/01-atoms/images/icons/icons.twig
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{ attach_library('emulsify/atoms.images.icons') }}

<div class="icons-demo" id="icons">
{% for item in icons %}
<div class="icons-demo__item">
Expand Down
5 changes: 5 additions & 0 deletions components/01-atoms/images/icons/libraries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
atoms.images.icons:
version: 0.1
css:
component:
dist/css/01-atoms/images/icons/_icons.css: {}
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
@mixin image {
display: block;
height: auto;
max-width: 100%;
}

img,
picture {
@include image;
Expand Down
5 changes: 5 additions & 0 deletions components/01-atoms/images/image/_image.mixin.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@mixin image {
display: block;
height: auto;
max-width: 100%;
}
2 changes: 2 additions & 0 deletions components/01-atoms/images/image/_image.twig
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{ attach_library('emulsify/atoms.images.image') }}

{% set image_base_class = image_base_class|default('image') %}

<img
Expand Down
2 changes: 2 additions & 0 deletions components/01-atoms/images/image/_picture.twig
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{ attach_library('emulsify/atoms.images.image') }}

{% set picture_base_class = picture_base_class|default('picture') %}

<picture
Expand Down
5 changes: 5 additions & 0 deletions components/01-atoms/images/image/libraries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
atoms.images.image:
version: 0.1
css:
component:
dist/css/01-atoms/images/image/_image.css: {}
3 changes: 3 additions & 0 deletions components/01-atoms/images/images.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import iconTwig from './icons/icons.twig';
import imageData from './image/image.yml';
import figureData from './image/figure.yml';

import './icons/_icons.component.scss';
import './image/_image.component.scss';

const svgIcons = require.context('../../../images/icons/', true, /\.svg$/);
const icons = [];
svgIcons.keys().forEach((key) => {
Expand Down
3 changes: 3 additions & 0 deletions components/01-atoms/links/link/_link.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.link {
@include link;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,3 @@
color: clr(accent-high);
}
}

.link {
@include link;
}
5 changes: 5 additions & 0 deletions components/01-atoms/links/link/libraries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
atoms.links.link:
version: 0.1
css:
component:
dist/css/01-atoms/links/link/_link.css: {}
2 changes: 2 additions & 0 deletions components/01-atoms/links/link/link.twig
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{ attach_library('emulsify/atoms.links.link') }}

{#
/**
* Available variables:
Expand Down
2 changes: 2 additions & 0 deletions components/01-atoms/links/link/links.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import link from './link.twig';

import linkData from './link.yml';

import './_link.component.scss';

/**
* Storybook Definition.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,3 @@ ol {

list-style-type: decimal;
}

.text-field {
li {
padding-left: $space;
}
}
5 changes: 5 additions & 0 deletions components/01-atoms/lists/libraries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
atoms.lists.list:
version: 0.1
css:
component:
dist/css/01-atoms/lists/_list.css: {}
2 changes: 2 additions & 0 deletions components/01-atoms/lists/list.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import listTwig from './list.twig';

import listData from './list.yml';

import './_list.component.scss';

/**
* Storybook Definition.
*/
Expand Down
2 changes: 2 additions & 0 deletions components/01-atoms/lists/list.twig
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{ attach_library('emulsify/atoms.lists.list') }}

{#
# Available variables:
# - list__items - the array of list items
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,3 @@
$table-border-width: 1px;

@mixin table-header-footer {
background-color: clr(highlight-high);

> * {
border-color: clr(highlight);
}
}

@mixin table-cell {
border: 0;
border-right-width: $table-border-width;
border-bottom-width: $table-border-width;
border-style: solid;
border-color: inherit;
padding: $space;

&:last-child {
border-right: 0;
}

:last-child > & {
border-bottom: 0;
}

&[data-cell-highlight] {
background-color: clr(highlight);
}
}

.table {
border: $table-border-width solid clr(highlight-high);
border-spacing: 0;
Expand Down
30 changes: 30 additions & 0 deletions components/01-atoms/tables/_tables.mixin.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
$table-border-width: 1px;

@mixin table-header-footer {
background-color: clr(highlight-high);

> * {
border-color: clr(highlight);
}
}

@mixin table-cell {
border: 0;
border-right-width: $table-border-width;
border-bottom-width: $table-border-width;
border-style: solid;
border-color: inherit;
padding: $space;

&:last-child {
border-right: 0;
}

:last-child > & {
border-bottom: 0;
}

&[data-cell-highlight] {
background-color: clr(highlight);
}
}
5 changes: 5 additions & 0 deletions components/01-atoms/tables/libraries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
atoms.tables:
version: 0.1
css:
component:
dist/css/01-atoms/tables/_tables.css: {}
2 changes: 2 additions & 0 deletions components/01-atoms/tables/tables.stories.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import tableTwig from './tables.twig';
import tableData from './tables.yml';

import './_tables.component.scss';

/**
* Storybook Definition.
*/
Expand Down
2 changes: 2 additions & 0 deletions components/01-atoms/tables/tables.twig
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{ attach_library('emulsify/atoms.tables') }}

{#
/**
* Available variables:
Expand Down
Loading