-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dae931d
commit 1996e41
Showing
14 changed files
with
164 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/*! @tacc/core-styles 2.17.5+ | MIT | github.com/TACC/Core-Styles */ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
@import url("./c-pill.selectors.css"); | ||
|
||
/* Base */ | ||
|
||
:--c-pill { | ||
font-weight: var(--medium); | ||
font-size: var(--global-font-size--x-small); | ||
|
||
display: inline-block; /* FAQ: Supports `min/max-width` */ | ||
box-sizing: border-box; /* override browser */ | ||
padding-inline: 0.75em; | ||
min-width: 6.5em; | ||
|
||
line-height: 1.4; | ||
text-align: center; | ||
text-transform: none; /* avoid inheritance form context e.g. <h1> */ | ||
border-radius: 0.5em; | ||
color: var(--global-color-primary--xx-dark); | ||
} | ||
|
||
|
||
|
||
/* Modifiers */ | ||
|
||
/* Modifiers - Structure */ | ||
|
||
/* CAVEAT: This alone may not trigger truncation */ | ||
/* SEE: https://confluence.tacc.utexas.edu/x/sAoFDg */ | ||
:--c-pill--should-truncate { | ||
max-width: 100%; | ||
|
||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
/* white-space: nowrap; */ /* FAQ: Let client decide */ | ||
|
||
/* Keep alignment that is changed by `overflow: hidden;` */ | ||
/* SEE: https://stackoverflow.com/q/25818199 */ | ||
vertical-align: bottom; | ||
} | ||
|
||
|
||
|
||
/* Modifiers */ | ||
|
||
/* Modifiers - Skin */ | ||
|
||
:--c-pill--is-danger { | ||
background-color: var(--global-color-danger--light); | ||
} | ||
:--c-pill--is-success { | ||
background-color: var(--global-color-success--normal); | ||
} | ||
:--c-pill--is-warning { | ||
background-color: var(--global-color-warning--normal); | ||
} | ||
:--c-pill--is-normal { | ||
background-color: var(--global-color-extra--light); | ||
} | ||
:--c-pill--is-fixed { | ||
background-color: var(--global-color-primary--light); | ||
} | ||
:--c-pill--is-updated { | ||
background-color: #FFF500; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
@import url("../tools/selectors.css"); | ||
|
||
@custom-selector :--c-pill | ||
.c-pill, | ||
[class*="pill--"]; | ||
|
||
@custom-selector :--c-pill--should-truncate | ||
.c-pill--should-truncate, | ||
[class*="pill--truncate"]; | ||
|
||
@custom-selector :--c-pill--is-danger | ||
.c-pill--is-danger, | ||
[class*="pill--danger"]; | ||
@custom-selector :--c-pill--is-success | ||
.c-pill--is-success, | ||
[class*="pill--success"]; | ||
@custom-selector :--c-pill--is-warning | ||
.c-pill--is-warning, | ||
[class*="pill--warning"]; | ||
@custom-selector :--c-pill--is-normal | ||
.c-pill--is-normal, | ||
[class*="pill--normal"]; | ||
@custom-selector :--c-pill--is-fixed | ||
.c-pill--is-fixed, | ||
[class*="pill--fixed"]; | ||
@custom-selector :--c-pill--is-updated | ||
.c-pill--is-updated, | ||
[class*="pill--updated"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<dl> | ||
<dt>Standard</dt> | ||
<dd class="demo-list"> | ||
{{#each types}}{{> @c-pill type=this name=this }}{{/each}} | ||
</dd> | ||
<dt>Custom</dt> | ||
<dd> | ||
Avoid custom pills. Interfaces ideally have a limited number of statuses. | ||
</dd> | ||
</dl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<dl class="demo-truncate"> | ||
<dt>Truncate</dt> | ||
<dd> | ||
{{> @c-pill type="normal" name="very long tag name" should-truncate=true }} | ||
</dd> | ||
</dl> |
1 change: 1 addition & 0 deletions
1
src/lib/_imports/components/c-pill/03-c-pill--html-elements.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{{> @inline-element-samples class="c-pill" name="pill" }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<span class="c-pill c-pill--is-{{ type }}{{#should-truncate}} c-pill--should-truncate{{/should-truncate}}">{{ name }}</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
context: | ||
types: | ||
- danger | ||
- success | ||
- warning | ||
- normal | ||
- fixed | ||
- updated | ||
variants: | ||
- name: default | ||
hidden: true | ||
- name: html-elements | ||
label: HTML Elements |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* This CSS is ONLY for the pattern library. It is NOT part of the pattern. */ | ||
|
||
.demo-truncate .c-pill { | ||
white-space: nowrap; | ||
max-width: 10em; | ||
} | ||
|
||
.demo-list { | ||
display: flex; | ||
flex-wrap: wrap; | ||
list-style-type: none; | ||
padding-left: 0; | ||
gap: 1em; | ||
} | ||
|
||
.c-pill:not([class*="c-pill--"]) { | ||
background-color: var(--global-color-primary--x-light); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
To label the status of something. | ||
|
||
| Class (Std.) | Class (Alt.) | Description | ||
| - | - | - | | ||
| `.c-pill` | `.pill` | space, shape, and size | ||
| `.c-pill--should-truncate` | `.pill--truncate` | truncate text* | ||
| `.c-pill--is-danger` | `.pill--danger` | for a "danger" status | ||
| `.c-pill--is-success` | `.pill--success` | for a "success" status | ||
| `.c-pill--is-...` | `.pill--...` | for a "..." status | ||
|
||
<small>* Requires client styles, because [truncation can be context-dependent](https://confluence.tacc.utexas.edu/x/sAoFDg).</small> | ||
|
||
<script> | ||
/* To open external links in new window */ | ||
Array.from(document.links) | ||
.filter(link => link.hostname != window.location.hostname) | ||
.forEach(link => link.target = '_blank'); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters