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(elements): html-el's demo, blockquote, figure #114

Merged
merged 1 commit into from
Jan 22, 2023
Merged
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 dist/core-styles.base.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-styles.cms.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-styles.demo.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/core-styles.docs.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/elements/demo.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/elements/html-elements.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/trumps/s-guide-doc.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions src/lib/_imports/_partials/figure.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<figure {{#if class}}class="{{ class }}"{{/if}}>
<img
src="https://cep.tacc.utexas.edu/media/filer_public_thumbnails/filer_public/69/85/698569d0-641f-4289-94c2-664389d626e8/spectrum-square-240px.png__240x240_q85_subject_location-120%2C120_subsampling-2.png"
alt="(sample image)"
/>
<figcaption>
I am a &lt;figcaption&gt; within a &lt;figure&gt;.
</figcaption>
</figure>
5 changes: 5 additions & 0 deletions src/lib/_imports/_partials/img.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<img
{{#if class}}class="{{ class }}"{{/if}}
src="https://cep.tacc.utexas.edu/media/filer_public_thumbnails/filer_public/69/85/698569d0-641f-4289-94c2-664389d626e8/spectrum-square-240px.png__240x240_q85_subject_location-120%2C120_subsampling-2.png"
alt="(sample image)"
/>
1 change: 1 addition & 0 deletions src/lib/_imports/core-styles.docs.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

/* COMPONENTS */
@import url("./components/admonition.css");
@import url("./components/align.css");
@import url("./components/tacc-docs.css");

/* TRUMPS */
Expand Down
57 changes: 29 additions & 28 deletions src/lib/_imports/elements/demo.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,34 @@ main {

/* Organize Content */

main > dl dl {
margin-block: 0;
padding-left: unset; /* overwrite CMS */
}
main > dl dt,
main > dl dd {
font-family: var(--global-font-family--sans);
color: #484848;
line-height: normal;
}
main > dl dt {
font-size: 1.6rem;
font-weight: var(--medium);
margin-bottom: 10px;
}
main > dl > dt {
font-weight: var(--bold);
}
main > dl dt:not(:first-of-type) {
margin-top: 20px;
}
main > dl dd {
margin-bottom: 10px;
margin-left: 25px;
}
main > dl dd:not(.demo-grid) > * {
margin-right: 5px;
vertical-align: middle;
main > dl {

&:is(dt, dd):not(.no-demo-styles > *) {
font-family: var(--global-font-family--sans);
color: #484848;
line-height: normal;
}
& dt:not(.no-demo-styles > *) {
font-size: 1.6rem;
font-weight: var(--medium);
margin-bottom: 10px;
}
& > dt:not(.no-demo-styles > *) {
font-weight: var(--bold);
}
& dt:not(:first-of-type):not(.no-demo-styles > *) {
margin-top: 20px;
}
& dd:not(.no-demo-styles > *) {
margin-bottom: 10px;
margin-left: 25px;
}

& dl:not(.no-demo-styles) {
margin-block: 0;
padding-left: unset; /* undo html-elements.cms.css */
}

}


Expand All @@ -51,6 +51,7 @@ main > dl dd:not(.demo-grid) > * {
body > main {
width: 80vw;
margin-inline: auto;
padding-block: 1em;
}

/* To show when body is covered by a full-width background */
Expand Down
25 changes: 20 additions & 5 deletions src/lib/_imports/elements/html-elements.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@





/*
Text Content
Form Content

Elements that create forms which allow users to enter and submit data.

Expand All @@ -31,6 +29,8 @@ Styleguide Elements.Forms
line-height: inherit;
}



/*
Text Content

Expand All @@ -47,12 +47,29 @@ Reference:
Styleguide Elements.TextContent
*/

& blockquote {
width: max-content;
margin-inline: unset; /* undo browser */
}
& blockquote > p:last-child {
margin-bottom: 0;
}

& figure {
width: min-content;
margin-inline: unset; /* undo browser */
}


/* To mimic Bootstrap */
& :is(dl, ol, ul) {
margin-top: 0;
margin-bottom: 1rem;
}




/*
Interactive Elements

Expand All @@ -77,6 +94,4 @@ Styleguide Elements.Interactive





}
1 change: 1 addition & 0 deletions src/lib/_imports/elements/html-elements/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
label: HTML Elements
80 changes: 80 additions & 0 deletions src/lib/_imports/elements/html-elements/html-elements.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<dl>

<dt>Forms</dt>
<dd>
<form>
<label>&lt;input&gt;</label>
<input />
<label>&lt;select&gt;</label>
<select>
<option value="" selected="">
Please select a dinosaur
</option>
<optgroup label="Theropods">
<option>Tyrannosaurus</option>
<option>Velociraptor</option>
<option>Deinonychus</option>
</optgroup>
<optgroup label="Sauropods">
<option>Diplodocus</option>
<option>Saltasaurus</option>
<option>Apatosaurus</option>
</optgroup>
</select>
<label>&lt;textarea&gt;</label>
<textarea></textarea>
<button type="submit">Submit</button>
<button type="reset">Reset</button>
<button type="clear">Clear</button>
<button type="button">Button</button>
</form>
</dd>

<dt>Text Content</dt>
<dd>
<dl>
<dt>Paragraphs</dt>
<dd>
<p>{{> @text-of-one-paragraph-medium }}</p>
<p>{{> @text-of-one-paragraph-medium }}</p>
</dd>

<dt>Lists</dt>
<dd>
<dl>
<dt>Unordered</dt>
<dd>
<ul>
<li>LX 1234</li>
<li>LOVE 45</li>
<li>OLD 555</li>
</ul>
</dd>
<dt>Ordered</dt>
<dd>
<ul>
<li>One Fish</li>
<li>Two Fish</li>
<li>Red Fish</li>
<li>Blue Fish</li>
</ul>
</dd>
<dt>Definition List</dt>
<dd>
<dl class="no-demo-styles">
<dt>CSS</dt><dd>Cascading Stylesheet</dd>
<dt>HTML</dt><dd>Hypertext Markup Language</dd>
<dt>JSON</dt><dd>JavaScript Object Notation</dd>
</dl>
</dd>
</dl>
</dd>

<dt>Figure</dt>
<dd>{{> @figure }}</dd>

<dt>Blockquote</dt>
<dd>{{> @blockquote }}</dd>
</dl>
</dd>
</dl>
1 change: 1 addition & 0 deletions src/lib/_imports/elements/html-elements/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Styling for raw HTML elements that are commonly used.
39 changes: 0 additions & 39 deletions src/lib/_imports/trumps/s-guide-doc.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,45 +12,6 @@ Styleguide Trumps.Scopes.GuideDoc

/* ELEMENTS */


/* ELEMENTS: Content Sectioning */

/* Fake <hr> above <h2> */
.s-guide-doc h2:not(hr + h2)::before {
display: block;
content: '';

/* To mirror hr (site.css) */
margin-top: var(--global-space--hr-buffer-above);
border-top: 1px solid var(--global-color-primary--light);
margin-bottom: var(--global-space--hr-buffer-below);
}


/* ELEMENTS: Text Content */

.s-guide-doc blockquote {
opacity: 0.75;
border: var(--global-border--normal);

padding: 1em;
}
.s-guide-doc blockquote > *:last-child { margin-bottom: 0; }

@media only screen and (min-width: 768px) {
blockquote { width: 600px; }
}

.s-guide-doc figure {
display: flex;
flex-direction: column;
align-items: center;
}
.s-guide-doc figcaption {
font-weight: bold;
}


/* ELEMENTS: Table Content */

.s-guide-doc table {
Expand Down