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(Skeleton-states): Add skeleton state styles #713

Merged
merged 20 commits into from
May 7, 2018
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
60 changes: 45 additions & 15 deletions src/components/accordion/_accordion.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
.#{$prefix}--accordion__arrow {
@include focus-outline('border');
overflow: visible; // safari fix
outline-offset: -.5px; // safari fix
outline-offset: -0.5px; // safari fix
}
}

Expand All @@ -53,7 +53,7 @@
.#{$prefix}--accordion__arrow {
@include focus-outline('border');
overflow: visible; // safari fix
outline-offset: -.5px; // safari fix
outline-offset: -0.5px; // safari fix
}
}
}
Expand Down Expand Up @@ -82,22 +82,52 @@
@include typescale('zeta');
}
}
}

.#{$prefix}--accordion__item--active {
overflow: visible;
.#{$prefix}--accordion__item--active {
overflow: visible;

.#{$prefix}--accordion__content {
padding-top: $spacing-md;
padding-bottom: $spacing-lg;
height: auto;
visibility: visible;
opacity: 1;
transition: all $transition--expansion $carbon--ease-in;
.#{$prefix}--accordion__content {
padding-top: $spacing-md;
padding-bottom: $spacing-lg;
height: auto;
visibility: visible;
opacity: 1;
transition: all $transition--expansion $carbon--ease-in;
}

.#{$prefix}--accordion__arrow {
transform: rotate(90deg);
fill: $brand-01;
}
}

.#{$prefix}--accordion__arrow {
transform: rotate(90deg);
fill: $brand-01;
// Skeleton state
.#{$prefix}--accordion.#{$prefix}--skeleton .#{$prefix}--accordion__heading,
.#{$prefix}--accordion.#{$prefix}--skeleton .#{$prefix}--accordion__button {
cursor: default;
}

.#{$prefix}--accordion.#{$prefix}--skeleton .#{$prefix}--accordion__arrow {
pointer-events: none;
fill: $ui-05;
cursor: default;

&:hover,
&:focus,
&:active {
border: none;
outline: none;
cursor: default;
}
}

.#{$prefix}--skeleton .#{$prefix}--accordion__heading:focus .#{$prefix}--accordion__arrow {
border: none;
outline: none;
cursor: default;
}

.#{$prefix}--accordion__title.#{$prefix}--skeleton__text {
margin-bottom: 0;
}
}
7 changes: 7 additions & 0 deletions src/components/breadcrumb/_breadcrumb.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,11 @@
}
}
}

// Skeleton State
.#{$prefix}--breadcrumb.#{$prefix}--skeleton .#{$prefix}--link {
@include skeleton;
width: rem(100px);
height: 1rem;
}
}
6 changes: 6 additions & 0 deletions src/components/button/_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,10 @@
.#{$prefix}--btn--tertiary + .#{$prefix}--btn--danger--primary {
margin-left: $spacing-md;
}

// Skeleton State
.#{$prefix}--btn.#{$prefix}--skeleton {
@include skeleton;
width: rem(150px);
}
}
12 changes: 12 additions & 0 deletions src/components/checkbox/_checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,16 @@
}
}
}

// Skeleton state
.#{$prefix}--checkbox-label.#{$prefix}--skeleton {
@include skeleton;
width: rem(100px);
height: rem(18px);

&:after,
&:before {
border: none;
}
}
}
20 changes: 20 additions & 0 deletions src/components/code-snippet/_code-snippet.scss
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,24 @@
top: 1rem;
right: 1.25rem;
}

// Skeleton State
.#{$prefix}--snippet--code.#{$prefix}--skeleton {
height: rem(98px);
}

.#{$prefix}--snippet--terminal.#{$prefix}--skeleton {
height: rem(56px);
}

.#{$prefix}--snippet.#{$prefix}--skeleton .#{$prefix}--snippet-container {
height: 100%;
}

.#{$prefix}--snippet.#{$prefix}--skeleton code {
@include skeleton;
width: 100%;
height: 1rem;
display: block;
}
}
45 changes: 45 additions & 0 deletions src/components/data-table-v2/_data-table-v2-skeleton.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
@import '../../globals/scss/import-once';

@include exports('data-table-v2-skeleton') {
.#{$prefix}--data-table-v2.#{$prefix}--skeleton {
th {
border-bottom: 1px solid $brand-01;

&:nth-child(3n + 1) {
width: 10%;
}

&:nth-child(3n + 2) {
width: 30%;
}

&:nth-child(3n + 3) {
width: 15%;
}
}

th span,
td span {
@include skeleton;
width: 75%;
height: 1rem;
display: block;
}

tr:hover {
td {
border-color: $ui-04;
background: transparent;

&:first-of-type,
&:last-of-type {
border-color: $ui-04;
}
}
}
}

.#{$prefix}--data-table-v2.#{$prefix}--skeleton .#{$prefix}--table-sort-v2 {
pointer-events: none;
}
}
1 change: 1 addition & 0 deletions src/components/data-table-v2/_data-table-v2.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
@import 'data-table-v2-expandable';
@import 'data-table-v2-sort';
@import 'data-table-v2-inline-edit';
@import 'data-table-v2-skeleton';
17 changes: 17 additions & 0 deletions src/components/date-picker/_date-picker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -349,4 +349,21 @@
.flatpickr-next-month {
padding-top: 5px;
}

// Skeleton State
.#{$prefix}--date-picker.#{$prefix}--skeleton input,
.#{$prefix}--date-picker__input.#{$prefix}--skeleton {
@include skeleton;
width: 100%;

&::-webkit-input-placeholder {
color: transparent;
}
}

.#{$prefix}--date-picker.#{$prefix}--skeleton .#{$prefix}--label {
@include skeleton;
width: rem(75px);
height: rem(14px);
}
}
5 changes: 5 additions & 0 deletions src/components/dropdown/_dropdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -212,4 +212,9 @@
color: $text-01;
}
}

// Skeleton State
.#{$prefix}--dropdown-v2.#{$prefix}--skeleton {
@include skeleton;
}
}
7 changes: 7 additions & 0 deletions src/components/form/_form.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@
opacity: 0.5;
}

// Skeleton State
.#{$prefix}--label.#{$prefix}--skeleton {
@include skeleton;
width: rem(75px);
height: rem(14px);
}

input[data-invalid],
textarea[data-invalid],
select[data-invalid] {
Expand Down
23 changes: 17 additions & 6 deletions src/components/number-input/_number-input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,24 @@
fill: $brand-02;
}
}
}

.#{$prefix}--number[data-invalid] {
input[type='number'] {
box-shadow: 0 2px 0px 0px $support-01;
.#{$prefix}--number[data-invalid] {
input[type='number'] {
box-shadow: 0 2px 0px 0px $support-01;
}
~ .#{$prefix}--form-requirement {
max-height: rem(200px);
}
}
~ .#{$prefix}--form-requirement {
max-height: rem(200px);

// Skeleton State
.#{$prefix}--number.#{$prefix}--skeleton {
@include skeleton;
width: 100%;
height: 2.5rem;

input[type='number'] {
display: none;
}
}
}
6 changes: 6 additions & 0 deletions src/components/pagination/_pagination.scss
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,10 @@ $css--helpers: true;
right: 0.3rem;
}
}

// Skeleton state
.#{$prefix}--pagination.#{$prefix}--skeleton .#{$prefix}--skeleton__text {
margin-right: 1rem;
margin-bottom: 0;
}
}
7 changes: 7 additions & 0 deletions src/components/progress-indicator/_progress-indicator.scss
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,11 @@
background-color: $brand-01;
}
}

// Skeleton State
.#{$prefix}--progress.#{$prefix}--skeleton .#{$prefix}--progress-label {
@include skeleton;
height: rem(12px);
width: rem(40px);
}
}
11 changes: 11 additions & 0 deletions src/components/radio-button/_radio-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,15 @@
.#{$prefix}--radio-button:focus + .#{$prefix}--radio-button__label .#{$prefix}--radio-button__appearance {
@include focus-outline('blurred');
}

// Skeleton State
.#{$prefix}--radio-button__label.#{$prefix}--skeleton {
@include skeleton;
width: rem(100px);
height: rem(18px);
}

.#{$prefix}--radio-button__label.#{$prefix}--skeleton .#{$prefix}--radio-button__appearance {
display: none;
}
}
10 changes: 10 additions & 0 deletions src/components/search/_search.scss
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,14 @@
.#{$prefix}--search-view--hidden {
display: none;
}

.#{$prefix}--search--lg.#{$prefix}--skeleton .#{$prefix}--search-input,
.#{$prefix}--search--sm.#{$prefix}--skeleton .#{$prefix}--search-input {
@include skeleton;
width: 100%;

&::-webkit-input-placeholder {
color: transparent;
}
}
}
10 changes: 10 additions & 0 deletions src/components/skeleton/_skeleton-icon.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@import '../../globals/scss/import-once';

@include exports('skeleton-icon') {
.#{$prefix}--icon--skeleton {
@include skeleton;
display: inline-block;
width: rem(16px);
height: rem(16px);
}
}
15 changes: 15 additions & 0 deletions src/components/skeleton/_skeleton-text.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@import '../../globals/scss/import-once';

@include exports('skeleton-text') {
.#{$prefix}--skeleton__text {
@include skeleton;
width: 100%;
height: 1rem;
margin-bottom: $spacing-xs;
}

.#{$prefix}--skeleton__heading {
height: 1.5rem;
margin-bottom: $spacing-sm;
}
}
6 changes: 6 additions & 0 deletions src/components/skeleton/_skeleton.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@import '../../globals/scss/vars';
@import '../../globals/scss/spacing';
@import '../../globals/scss/helper-mixins';

@import 'skeleton-text';
@import 'skeleton-icon';
Loading