Skip to content

Commit

Permalink
GH-73: Texascale: c-offset-… → o-offset-…
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleyboar committed Jul 9, 2021
1 parent 1fe7529 commit 49af07d
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 8 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/* WARNING: Deprecated. Do NOT add this to markup! */
/* NOTE: Preserve for legacy support (unless you want to edit 50+ instances) */
/* FAQ: 2019–20 used `c-offset-content`; 2021, renamed to `c-offset-content` */
/* SEE: ../../objects/c-offset-content.css */
/*
Offset Content
Content that should be offset from the flow of text within which it is placed.
Styleguide Components.Deprecated.OffsetContent
*/

[class*="c-offset-content--"] {
--offset-distance: 8.5vw; /* NOTE: Value is from Texascale.org 2020 */
--buffer: 30px; /* double Bootstrap `.col` padding */

max-width: 50%;
}

@media only screen and (--medium-and-above) {
.c-offset-content--right {
float: right;
margin-left: var(--buffer);
}
.c-offset-content--right + .c-offset-content--right { clear: right; }

.c-offset-content--left {
float: left;
margin-right: var(--buffer);
}
.c-offset-content--left + .c-offset-content--left { clear: left; }
}
/* WARNING: Value `2400px` is from Texascale.org 2020 */
@media only screen and (--medium-and-above) and (max-width: 2400px) {
/* Apply negative margin only when using offset value */
.c-offset-content--right {
margin-right: calc( var(--offset-distance) * -1);
}
.c-offset-content--left {
margin-left: calc( var(--offset-distance) * -1);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* SEE: taccsite_cms/static/site_cms/css/src/_imports/objects/o-offset-content.css */

[class*="o-offset-content--"] {
--offset-distance: 8.5vw;
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ Styleguide Trumps.Scopes.Article
/* Do this only for those viewports when content is actually offset */
@media only screen and (min-width: 992px) and (max-width: 2400px) {
/* If element is too wide, then the offset is negligible */
.s-article-page [class*="c-offset-content--"] {
.s-article-page [class*="c-offset-content--"], /* FAQ: Deprecated */
.s-article-page [class*="o-offset-content--"] {
max-width: calc( var(--offset-distance) * 4 );
}
}
4 changes: 2 additions & 2 deletions texascale-org/static/texascale-org/css/src/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
@import url("_imports/elements/html-elements.css");

/* OBJECTS */
/* … */
@import url("_imports/objects/o-offset-content.css");

/* COMPONENTS */
@import url("_imports/components/wip.byline.css");
/* RFC: If only used on articles, then these components could be imported into `template.article.css` instead */
@import url("_imports/components/c-offset-content.css");
@import url("_imports/components/bootstrap.figure.css");
@import url("_imports/components/bootstrap.blockquote.css");
@import url("_imports/components/deprecated/c-offset-content.css");

/* TRUMPS */
@import url("_imports/trumps/s-drop-caps.css");
Expand Down

0 comments on commit 49af07d

Please sign in to comment.