Skip to content

Commit

Permalink
Merge pull request #22 from accessibility-in-action/feat/blockquote
Browse files Browse the repository at this point in the history
feat: add blockquote element (resolves #19)
  • Loading branch information
greatislander authored Mar 22, 2021
2 parents 406eace + 715ca43 commit 8c0cf8c
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/style.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion fractal.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const fractal = module.exports = require("@frctl/fractal").create();

fractal.set("project.title", "Looseleaf Prototyping Library");
fractal.set("project.title", "Looseleaf Framework");
fractal.components.engine("@frctl/nunjucks");
fractal.components.set("ext", ".njk");
fractal.components.set("path", __dirname + "/src/components");
Expand Down
5 changes: 5 additions & 0 deletions src/components/elements/03-blockquote/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Blockquote

Blockquotes can include a citation, which should be wrapped in a [`<cite>` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/cite).
The em dash that precedes a citation is added using generated content, so only
the name or work cited needs to be include within the `<cite>` element.
9 changes: 9 additions & 0 deletions src/components/elements/03-blockquote/blockquote.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const faker = require("faker");

module.exports = {
status: "ready",
context: {
quote: faker.lorem.sentence(9),
citation: "Anonymous"
}
};
4 changes: 4 additions & 0 deletions src/components/elements/03-blockquote/blockquote.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<blockquote>
{% render "@p", {content: quote} %}
{% if citation %}<cite>{{ citation }}</cite>{% endif %}
</blockquote>
16 changes: 16 additions & 0 deletions src/css/elements/_blockquote.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
blockquote {
border-left: var(--ll-border-medium);
border-top-left-radius: 0.125em 100%;
font-size: var(--step-1);
padding-inline-start: var(--step-0);
}

cite {
font-size: var(--step-0);
font-style: normal;
padding-inline-start: 2ch;
}

cite::before {
content: "–";
}
1 change: 1 addition & 0 deletions src/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
@import "./base/base.css";
@import "./base/utilities.css";
@import "./base/typography.css";
@import "./elements/blockquote.css";
@import "./elements/thematic-break.css";
@import "./elements/link.css";
@import "./elements/button.css";
Expand Down

0 comments on commit 8c0cf8c

Please sign in to comment.