Skip to content
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
1 change: 1 addition & 0 deletions dist/tools/x-offset-content.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/*! @tacc/core-styles 2.52.0+ | MIT | github.com/TACC/Core-Styles */
1 change: 1 addition & 0 deletions dist/tools/x-offset-content.demo.css

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

16 changes: 10 additions & 6 deletions src/lib/_imports/_partials/figure.hbs
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
<figure {{#if class}}class="{{ class }}"{{/if}}>
{{#if use-image-wide}}
{{> @img large=true wide=true }}
{{> @img large=true wide=true class=img-class }}
{{else if use-image-tall}}
{{> @img large=true tall=true }}
{{> @img large=true tall=true class=img-class }}
{{else}}
{{> @img }}
{{> @img class=img-class }}
{{/if}}
<figcaption>
I am a &lt;figcaption&gt; within a &lt;figure&gt;.
{{> @message tag="span" type="warning" scope="inline"
content="I may be wider than image. If so, should I wrap?" }}
{{#if caption}}
{{{ caption }}}
{{else}}
I am a &lt;figcaption&gt; within a &lt;figure&gt;.
{{> @message tag="span" type="warning" scope="inline"
content="I may be wider than image. If so, should I wrap?" }}
{{/if}}
</figcaption>
</figure>
37 changes: 20 additions & 17 deletions src/lib/_imports/objects/o-offset-content.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,45 +8,48 @@ Content that should be:
Styleguide Objects.OffsetContent
*/
@import url("../tools/media-queries.css");
@import url("../tools/x-offset-content.css");

.o-offset-content--left,
.o-offset-content--right {
--offset-distance: 12vw;
--buffer: calc( 2 * var(--global-space--grid-gap) );

max-width: 85%;
@mixin offset-content;
}

/* To merely float content on narrow screens */
@media only screen and (--medium-and-above) {
.o-offset-content--right {
float: right;
margin-left: var(--buffer);
@mixin offset-content--float-right;
& + & {
@mixin offset-content--terminate-offset-right;
}
}
.o-offset-content--right + .o-offset-content--right { clear: right; }

.o-offset-content--left {
float: left;
margin-right: var(--buffer);
@mixin offset-content--float-left;
& + & {
@mixin offset-content--terminate-offset-left;
}
}
.o-offset-content--left + .o-offset-content--left { clear: left; }

.figure:is(
.o-offset-content--left,
.o-offset-content--right
/* WARNING: Seems specific to one website's use case */
/* TODO: Determine whether to apply to:
<figcaption>, only CMS, only Texascale */
.figure:is(
.o-offset-content--left,
.o-offset-content--right
) .figure-caption {
padding-right: 125px;
}
padding-right: 125px;
}
}

/* To offset content only on wide screens */
/* HELP: Do designers want to prevent offset on mega-wide screens */
/* FAQ: M.S. did on texascale.org but that may have been only for that site */
@media only screen and (--medium-and-above)/* and (--max-wide-and-below) */{
.o-offset-content--right {
margin-right: calc( var(--offset-distance) * -1);
@mixin offset-content--offset-right;
}
.o-offset-content--left {
margin-left: calc( var(--offset-distance) * -1);
@mixin offset-content--offset-left;
}
}
3 changes: 3 additions & 0 deletions src/lib/_imports/objects/o-offset-content/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
status: ready
context:
shouldSkipPattern: false
13 changes: 13 additions & 0 deletions src/lib/_imports/objects/o-offset-content/o-offset-content.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris.</p>

{{> @figure class="o-offset-content--right" caption="This figure is offset to the right.<br>On narrow screens, it is<br><strong>not</strong> explicitely offset." }}

<p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>

<p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.</p>

{{> @figure class="o-offset-content--left" caption="This figure is offset to the left.<br>On narrow screens, it is<br><strong>not</strong> explicitely offset." }}

<p>Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet.</p>

<p>At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident.</p>
10 changes: 10 additions & 0 deletions src/lib/_imports/objects/o-offset-content/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Content that should be:
1. offset from the flow of text within which it is placed
2. not offset at narrow viewports

| Class | Description
| - | - |
| `.offset-content--left` | offset content to the left |
| `.offset-content--right` | offset content to the right |

<script src="{{path '/assets/_utils/js/open-ext-links-in-new-window.js'}}" />
37 changes: 37 additions & 0 deletions src/lib/_imports/tools/x-offset-content.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/* Base */

@define-mixin offset-content {
--offset-distance: 12vw;
--buffer: calc( 2 * var(--global-space--grid-gap) );

max-width: 85%;
}


/* Modifiers */

@define-mixin offset-content--float-left {
float: left;
margin-right: var(--buffer);
}

@define-mixin offset-content--float-right {
float: right;
margin-left: var(--buffer);
}

@define-mixin offset-content--offset-left {
margin-left: calc( var(--offset-distance) * -1);
}

@define-mixin offset-content--offset-right {
margin-right: calc( var(--offset-distance) * -1);
}

@define-mixin offset-content--terminate-offset-left {
clear: left;
}

@define-mixin offset-content--terminate-offset-right {
clear: right;
}
24 changes: 24 additions & 0 deletions src/lib/_imports/tools/x-offset-content.demo.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* This CSS is ONLY for the pattern library. It is NOT part of the pattern. */

@import url("./x-offset-content.css");

.x-offset-content--left,
.x-offset-content--right {
@mixin offset-content;
}

.x-offset-content--right {
@mixin offset-content--float-right;
@mixin offset-content--offset-right;
& + & {
@mixin offset-content--terminate-offset-right;
}
}

.x-offset-content--left {
@mixin offset-content--float-left;
@mixin offset-content--offset-left;
& + & {
@mixin offset-content--terminate-offset-left;
}
}
5 changes: 5 additions & 0 deletions src/lib/_imports/tools/x-offset-content/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
status: ready
context:
shouldSkipPattern: false
supportStyles:
- ../../assets/tools/x-offset-content.demo.css
14 changes: 14 additions & 0 deletions src/lib/_imports/tools/x-offset-content/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Mixins for content that can be offset from the flow of text within which it is placed.

| Mixin | Description
| - | -
| `offset-content` | base styles |
| `offset-content--float-left` | float content to the left |
| `offset-content--float-right` | float content to the right |
| `offset-content--offset-left` | offset content to the left |
| `offset-content--offset-right` | offset content to the right |
| `offset-content--terminate-offset-left` | terminate offset sequence for left-floated content (prevents consecutive elements from stacking) |
| `offset-content--terminate-offset-right` | terminate offset sequence for right-floated content (prevents consecutive elements from stacking) |
| `offset-content__figure-caption` | style for figure captions within offset content |

<script src="{{path '/assets/_utils/js/open-ext-links-in-new-window.js'}}" />
14 changes: 14 additions & 0 deletions src/lib/_imports/tools/x-offset-content/x-offset-content.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris.</p>

{{> @figure class="x-offset-content--right" caption="This figure is offset to the right." }}

<p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>

<p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.</p>

{{> @figure class="x-offset-content--left" caption="This figure is offset to the left." }}

<p>Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet.</p>

<p>At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident.</p>