Skip to content
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

feat(demo): elements > (cms) headings pattern #92

Merged
merged 3 commits into from
Dec 14, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
feat(elements): headings as their own pattern
Also, two new partials for lorem ipsum paragraphs.
  • Loading branch information
wesleyboar committed Dec 14, 2022
commit 7613841e3eb123baec1d53902f1fc364664409be
1 change: 1 addition & 0 deletions src/lib/_imports/_partials/text-of-one-paragraph-long.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{> @text-of-one-paragraph-medium }} {{> @text-of-one-paragraph-medium }} {{> @text-of-one-paragraph-medium }} {{> @text-of-one-paragraph-medium }}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{> @text-of-one-paragraph-short }} {{> @text-of-one-paragraph-short }} {{> @text-of-one-paragraph-short }} {{> @text-of-one-paragraph-short }}
1 change: 1 addition & 0 deletions src/lib/_imports/core-styles.cms.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
/* ELEMENTS */
/* To override Bootstrap */
@import url("./elements/html-elements.cms.css");
@import url("./elements/headings.cms.css");
@import url("./elements/form.cms.css");

/* OBJECTS */
Expand Down
42 changes: 42 additions & 0 deletions src/lib/_imports/elements/headings.cms.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
h1, h2, h3, h4, h5, h6 {
color: var(--global-color-primary--xx-dark);
}
h1, h2, h4, h5, h6 {
font-weight: var(--bold);
}

h1 {
margin-top: 27px;
margin-bottom: 27px;
}
h2 {
margin-top: 30px;
margin-bottom: var(--global-space--normal);
}
h1 + h2,
h1 + hr {
margin-top: -12px;
}
h1 {
font-size: var(--global-font-size--xxx-large);
}
h2 {
font-size: var(--global-font-size--x-large);
}

h3, h4, h5, h6 {
margin-top: var(--global-space--normal);
margin-bottom: var(--global-space--normal);
}
h3 {
font-size: var(--global-font-size--x-large);
}
h4 {
font-size: var(--global-font-size--large);
}
h5 {
text-transform: uppercase;
}
h5, h6 {
font-size: var(--global-font-size--medium);
}
4 changes: 4 additions & 0 deletions src/lib/_imports/elements/headings.cms/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
label: (CMS) Headings
context:
shouldLoadCMS: true
shouldLoadBootstrap: true
32 changes: 32 additions & 0 deletions src/lib/_imports/elements/headings.cms/headings.cms.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<dl>
<dt>above each other</dt>
<dd>
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
</dd>
<dt>above paragraphs</dt>
<dd>
<h1>Heading 1</h1>
<p>{{> @text-of-one-paragraph-medium }}</p>
<p>{{> @text-of-one-paragraph-medium }}</p>
<h2>Heading 2</h2>
<p>{{> @text-of-one-paragraph-medium }}</p>
<p>{{> @text-of-one-paragraph-medium }}</p>
<h3>Heading 3</h3>
<p>{{> @text-of-one-paragraph-medium }}</p>
<p>{{> @text-of-one-paragraph-medium }}</p>
<h4>Heading 4</h4>
<p>{{> @text-of-one-paragraph-medium }}</p>
<p>{{> @text-of-one-paragraph-medium }}</p>
<h5>Heading 5</h5>
<p>{{> @text-of-one-paragraph-medium }}</p>
<p>{{> @text-of-one-paragraph-medium }}</p>
<h6>Heading 6</h6>
<p>{{> @text-of-one-paragraph-medium }}</p>
<p>{{> @text-of-one-paragraph-medium }}</p>
</dd>
</dl>
12 changes: 12 additions & 0 deletions src/lib/_imports/elements/headings.cms/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Heading elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements) represent six levels of section headings.

```
<h1> <h2> <h3> <h4> <h5> <h6>
```

<script>
/* To open external links in new window */
Array.from(document.links)
.filter(link => link.hostname != window.location.hostname)
.forEach(link => link.target = '_blank');
</script>
44 changes: 1 addition & 43 deletions src/lib/_imports/elements/html-elements.cms.css
Original file line number Diff line number Diff line change
Expand Up @@ -72,49 +72,7 @@ body > main + footer {
}

/* Headings */

h1, h2, h3, h4, h5, h6 {
color: var(--global-color-primary--xx-dark);
}
h1, h2, h4, h5, h6 {
font-weight: var(--bold);
}

h1 {
margin-top: 27px;
margin-bottom: 27px;
}
h2 {
margin-top: 30px;
margin-bottom: var(--global-space--normal);
}
h1 + h2,
h1 + hr {
margin-top: -12px;
}
h1 {
font-size: var(--global-font-size--xxx-large);
}
h2 {
font-size: var(--global-font-size--x-large);
}

h3, h4, h5, h6 {
margin-top: var(--global-space--normal);
margin-bottom: var(--global-space--normal);
}
h3 {
font-size: var(--global-font-size--x-large);
}
h4 {
font-size: var(--global-font-size--large);
}
h5 {
text-transform: uppercase;
}
h5, h6 {
font-size: var(--global-font-size--medium);
}
/* SEE: ./headings.cms.css */



Expand Down