Skip to content

Commit

Permalink
feat: updates from tup-ui (except paths)
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleyboar committed Jul 25, 2022
1 parent 8d5129c commit 25d184d
Show file tree
Hide file tree
Showing 25 changed files with 721 additions and 27 deletions.
2 changes: 1 addition & 1 deletion src/lib/_imports/components/bootstrap.container.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Add to Bootstrap styles. See:
Styleguide Components.Bootstrap.Grid
*/
@import url("_imports/tools/media-queries.css");
@import url("../tools/media-queries.css");

@media (--x-wide-and-above) {
.container { max-width: var(--global-max-width--x-wide); }
Expand Down
21 changes: 21 additions & 0 deletions src/lib/_imports/components/bootstrap.form.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
Form (Bootstrap)
Override Bootstrap styles. See:
- [ReactStrap Forms](https://reactstrap.github.io/components/form/)
- [Bootstrap Forms](https://getbootstrap.com/docs/4.4/components/forms/)
Styleguide Components.Bootstrap.Form
*/
@import url('../settings/border.css');

.form-control {
border: var(--global-border--normal);
border-radius: 0;
}
input.form-control,
textarea.form-control {
/* FAQ: Vertical padding reduced by 1px each to near input height of design * 1.2 */
padding: 6px 12px; /* 6px 10px design * 1.2 design-to-app ratio */
}
.input-group-prepend {
z-index: 1; /* so child button border is above sibling input border */
}
74 changes: 74 additions & 0 deletions src/lib/_imports/components/bootstrap.modal.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/* TODO: Migrate any other should-be-global Portal modal styles to here */
/* FP-344: Consider a Modal component and a CSS module */
/*
Modal (Bootstrap)
Override Bootstrap styles. See:
- [ReactStrap Forms](https://reactstrap.github.io/components/modals/)
- [Bootstrap Forms](https://getbootstrap.com/docs/4.4/components/modal/)
Styleguide Components.Bootstrap.Modal
*/
@import url('../tools/x-truncate.css');

.modal-content,
.modal-header,
.modal-body,
.modal-footer {
border-radius: 0;
}
.modal-content,
.modal-header,
.modal-body {
border: none;
}
.modal-footer {
border-left: none;
border-right: none;
border-bottom: none;
}

.modal-header {
background-color: var(--global-color-primary--x-light);
padding: 1.35rem 1.75rem; /* (18px 23.5px design * 1.2 design-to-app ratio) */
}
.modal-title {
color: var(--global-color-primary--xx-dark);
font-weight: normal;
font-size: 1.2rem; /* 16px design * 1.2 design-to-app ratio */

@extend .x-truncate--one-line;
}

/* To darken close button */
.modal-header .close {
color: var(--global-color-primary--x-dark);
opacity: 1;
}
/* FAQ: The specificity matches Bootstrap */
.modal-header .close:not(:disabled):not(.disabled):focus,
.modal-header .close:not(:disabled):not(.disabled):hover {
color: var(--global-color-primary--xx-dark);
opacity: 1;
}

/* To render modal close button icon as a Cortal icon */
/* CAVEAT: Pass `charCode="&#xe912;"` to `<ModalHeader>` */
.modal-header .close span {
/* To mimic `.icon` styles without `@extend` or `composes` (unavailable) */
/* HACK: Copied (and reduced and edited) from `src/styles/trumps/icon...` */
font-size: 1.5rem; /* bigger to match header text font height (like design) */
font-family: Cortal-Icons !important;
}

.modal-header.has-MuiTabs {
flex-direction: row;
position: relative;
height: 63.5px;
border-bottom: 1px solid #afafaf;
padding: 5px;
}
.modal-header.has-MuiTabs .close {
transform: translate(-25%, 25%);
}
2 changes: 1 addition & 1 deletion src/lib/_imports/components/bootstrap.pagination.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Style Bootstrap pagination. See:
Styleguide Components.Bootstrap.Pagination
*/
@import url("_imports/components/c-page.css");
@import url("../components/c-page.css");



Expand Down
13 changes: 12 additions & 1 deletion src/lib/_imports/components/c-button.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import url("_imports/tools/x-truncate.css");
@import url("../tools/x-truncate.css");



Expand Down Expand Up @@ -235,6 +235,13 @@

/* Modifiers: Sizes */

.c-button:not(
.c-button--width-short,
.c-button--width-medium,
.c-button--width-long,
.c-button--size-small,
.c-button--as-link
),
.c-button--width-short {
width: var(--min-width);
}
Expand All @@ -256,6 +263,10 @@

/* Elements */

.c-button > * {
vertical-align: middle;
}

.c-button__icon--before {
margin-right: 0.5em;
}
Expand Down
8 changes: 5 additions & 3 deletions src/lib/_imports/components/c-button/c-button.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@
<dt>Icons</dt>
<dd>
<button class="c-button c-button--{{this._self.name}}
{{#if supports.width}}c-button--width-long{{/if}}
{{#if type}}{{type}}{{/if}}"
{{#if disabled}}disabled{{/if}}>
<i class="c-button__icon--before" aria-description="validate input">…</i>
<span class="c-button__text">__icon--before</span>
</button>
<button class="c-button c-button--{{this._self.name}}
{{#if supports.width}}c-button--width-long{{/if}}
{{#if type}}{{type}}{{/if}}"
{{#if disabled}}disabled{{/if}}>
<span class="c-button__text">__icon--after</span>
Expand All @@ -58,7 +60,7 @@
{{#if supports.width}}
<dt>Width</dt>
<dd>
<button class="c-button c-button--{{this._self.name}} c-button--width-short
<button class="c-button c-button--{{this._self.name}}
{{#if type}}{{type}}{{/if}}"
{{#if disabled}}disabled{{/if}}>
<span class="c-button__text">--width-short</span>
Expand All @@ -67,9 +69,9 @@
{{#if disabled}}disabled{{/if}}>
<span class="c-button__text">--width-medium</span>
</button>
<button class="c-button c-button--{{this._self.name}} c-button--width-large {{#if type}}{{type}}{{/if}}"
<button class="c-button c-button--{{this._self.name}} c-button--width-long {{#if type}}{{type}}{{/if}}"
{{#if disabled}}disabled{{/if}}>
<span class="c-button__text">--width-large</span>
<span class="c-button__text">--width-long</span>
</button>
</dd>
{{/if}}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/_imports/components/c-callout.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Markup: c-callout.html
Styleguide Components.Callout
*/
@import url("_imports/tools/media-queries.css");
@import url("_imports/tools/x-article-link.css");
@import url("../tools/media-queries.css");
@import url("../tools/x-article-link.css");



Expand Down
2 changes: 1 addition & 1 deletion src/lib/_imports/components/c-card.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Markup: c-card.html
Styleguide Components.Card
*/
@import url("_imports/tools/x-article-link.css");
@import url("../tools/x-article-link.css");

/* Modifiers */

Expand Down
2 changes: 1 addition & 1 deletion src/lib/_imports/components/c-data-list.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Markup: c-data-list.html
Styleguide Components.DataList
*/
@import url("_imports/tools/x-truncate.css");
@import url("../tools/x-truncate.css");



Expand Down
2 changes: 1 addition & 1 deletion src/lib/_imports/components/c-nav.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Markup: c-nav.html
Styleguide Components.Nav
*/
@import url("_imports/tools/media-queries.css");
@import url("../tools/media-queries.css");



Expand Down
2 changes: 1 addition & 1 deletion src/lib/_imports/components/c-see-all-link.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Markup:
Styleguide Components.SeeAllLink
*/
@import url("_imports/tools/x-truncate.css");
@import url("../tools/x-truncate.css");



Expand Down
2 changes: 1 addition & 1 deletion src/lib/_imports/components/c-show-more.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ A CSS-only way to support a "Show More…" feature. It requires a container and
Styleguide: Components.ShowMore
*/
@import url("_imports/tools/x-truncate.css");
@import url("../tools/x-truncate.css");

/* Truncation */

Expand Down
79 changes: 79 additions & 0 deletions src/lib/_imports/components/cortal.icon.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/*
Container (Bootstrap)
Provide Cortal Icon styles. See:
- [Cortal Icons (Confluence)](https://confluence.tacc.utexas.edu/x/MCAFDg)
Styleguide Components.Cortal.Icon
*/
@import url('./cortal.icon.font.css');



/* IMPORTANT: Do not add support for icons that neglect `.icon` class */
/* FAQ: Users should build their icons to spec */



/* Aliases */
/* SEE: https://github.com/TACC/Core-Portal/blob/22405ca/client/src/styles/trumps/icon.css#L57 */

/* CAVEAT: Urgent use only; always prefer official icon names */



/* Overrides */

/* To overwrite `cortal.icon.fonts.css` icon sizes */
/* SEE: https://confluence.tacc.utexas.edu/x/dgB_CQ */
/* CAVEAT: Assumes 1rem = 10px */
/* relative units */
.icon-sm {
font-size: 1.8rem;
}
.icon-md {
font-size: 2.4rem;
}
.icon-lg {
font-size: 6.4rem;
}
/* absolute units */
.icon-18 {
font-size: 18px;
}
.icon-24 {
font-size: 24px;
}
.icon-64 {
font-size: 64px;
}
.icon-16,
.icon-32 { font-size: unset /* to disallow unsupported font sizes */ }



/* Placeholders */
/* FAQ: Some icons do not exist, but can be faked (with caveats) */

/* To create a small "chevron" */
/* CAVEAT: Use `--color` to set color */
[class*='icon-nav-'] {
border: solid var(--color, var(--global-color-primary--xx-dark));
border-width: 0 0.25em 0.25em 0;
font-size: 8px;
/* display: inline-block; */ /* let `.icon`'s `display: inline-flex;` do it */
/* padding: var(--size); */ /* let `.icon`'s equal `width` & `height` do it */
}
.icon-nav-up {
transform: rotate(-135deg);
}
.icon-nav-left {
transform: rotate(135deg);
}
.icon-nav-down {
transform: rotate(45deg);
}
.icon-nav-right {
transform: rotate(-45deg);
}
464 changes: 464 additions & 0 deletions src/lib/_imports/components/cortal.icon.font.css

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/lib/_imports/components/cortal.icon.font.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Cortal Icon Font

The file `cortal.icon.font.css` comes from raw CSS provided by latest version of [TACC's "Cortal" icon font](https://confluence.tacc.utexas.edu/x/MCAFDg).
33 changes: 33 additions & 0 deletions src/lib/_imports/objects/o-fixed-header-table.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
Fixed Header Table
A table with a header that does not move, and a body that scrolls.
Markup:
<table class="o-fixed-header-table">
<thead>
<tr>
<th>A</th>
<th>B</th>
<th>C</th>
</tr>
</thead>
<tbody>
<tr>
<td>A</td>
<td>B</td>
<td>C</td>
</tr>
</thead>
</table>
Styleguide Objects.FixedHeaderTable
*/
/* SEE: https://css-tricks.com/position-sticky-and-table-headers/ */
.o-fixed-header-table th {
position: sticky;
top: 0;

z-index: 1; /* so table content (e.g. button)¹ does not scroll over <th> */
/* ¹ table content with a `position` value other than static */
}
4 changes: 2 additions & 2 deletions src/lib/_imports/objects/o-grid.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Markup: o-grid.html
Styleguide Objects.Grid
*/
@import url("_imports/tools/media-queries.css");
@import url("_imports/tools/x-grid.css");
@import url("../tools/media-queries.css");
@import url("../tools/x-grid.css");



Expand Down
2 changes: 1 addition & 1 deletion src/lib/_imports/objects/o-offset-content.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Content that should be offset from the flow of text within which it is placed.
Styleguide Objects.OffsetContent
*/
@import url("_imports/tools/media-queries.css");
@import url("../tools/media-queries.css");



Expand Down
6 changes: 3 additions & 3 deletions src/lib/_imports/objects/o-section.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ Markup: o-section.html
Styleguide Objects.Section
*/
@import url("_imports/tools/media-queries.css");
@import url("_imports/tools/x-layout.css");
@import url("_imports/tools/x-fake-border.css");
@import url("../tools/media-queries.css");
@import url("../tools/x-layout.css");
@import url("../tools/x-fake-border.css");



Expand Down

0 comments on commit 25d184d

Please sign in to comment.