0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-01-17 09:52:29 +01:00

Reorganize utilities into more separate files under a /scss/utilities/ directory

[skip sauce]
[skip validator]
This commit is contained in:
Chris Rebert 2015-12-10 19:43:28 -08:00
parent 1e8743ec89
commit 7aabd49364
10 changed files with 98 additions and 99 deletions

View File

@ -1,95 +1,8 @@
//
// Floats
//
.clearfix {
@include clearfix();
}
.center-block {
@include center-block();
}
@each $breakpoint in map-keys($grid-breakpoints) {
@include media-breakpoint-up($breakpoint) {
.pull-#{$breakpoint}-left {
@include pull-left();
}
.pull-#{$breakpoint}-right {
@include pull-right();
}
.pull-#{$breakpoint}-none {
float: none !important;
}
}
}
//
// Screenreaders
//
.sr-only {
@include sr-only();
}
.sr-only-focusable {
@include sr-only-focusable();
}
.invisible {
visibility: hidden !important;
}
.text-hide {
@include text-hide();
}
//
// Text
//
// Alignment
.text-justify { text-align: justify !important; }
.text-nowrap { white-space: nowrap !important; }
.text-truncate { @include text-truncate; }
// Responsive alignment
@each $breakpoint in map-keys($grid-breakpoints) {
@include media-breakpoint-up($breakpoint) {
.text-#{$breakpoint}-left { text-align: left !important; }
.text-#{$breakpoint}-right { text-align: right !important; }
.text-#{$breakpoint}-center { text-align: center !important; }
}
}
// Transformation
.text-lowercase { text-transform: lowercase !important; }
.text-uppercase { text-transform: uppercase !important; }
.text-capitalize { text-transform: capitalize !important; }
// Weight and italics
.font-weight-normal { font-weight: normal; }
.font-weight-bold { font-weight: bold; }
.font-italic { font-style: italic; }
// Contextual colors
.text-muted {
color: $text-muted;
}
@include text-emphasis-variant('.text-primary', $brand-primary);
@include text-emphasis-variant('.text-success', $brand-success);
@include text-emphasis-variant('.text-info', $brand-info);
@include text-emphasis-variant('.text-warning', $brand-warning);
@include text-emphasis-variant('.text-danger', $brand-danger);
@import "utilities/background";
@import "utilities/center-block";
@import "utilities/clearfix";
@import "utilities/pulls";
@import "utilities/screenreaders";
@import "utilities/spacing";
@import "utilities/text";
@import "utilities/visibility";

3
scss/bootstrap.scss vendored
View File

@ -51,6 +51,3 @@
// Utility classes
@import "utilities";
@import "utilities-background";
@import "utilities-spacing";
@import "utilities-responsive";

View File

@ -0,0 +1,3 @@
.center-block {
@include center-block();
}

View File

@ -0,0 +1,3 @@
.clearfix {
@include clearfix();
}

View File

@ -0,0 +1,13 @@
@each $breakpoint in map-keys($grid-breakpoints) {
@include media-breakpoint-up($breakpoint) {
.pull-#{$breakpoint}-left {
@include pull-left();
}
.pull-#{$breakpoint}-right {
@include pull-right();
}
.pull-#{$breakpoint}-none {
float: none !important;
}
}
}

View File

@ -0,0 +1,11 @@
//
// Screenreaders
//
.sr-only {
@include sr-only();
}
.sr-only-focusable {
@include sr-only-focusable();
}

53
scss/utilities/_text.scss Normal file
View File

@ -0,0 +1,53 @@
//
// Text
//
// Alignment
.text-justify { text-align: justify !important; }
.text-nowrap { white-space: nowrap !important; }
.text-truncate { @include text-truncate; }
// Responsive alignment
@each $breakpoint in map-keys($grid-breakpoints) {
@include media-breakpoint-up($breakpoint) {
.text-#{$breakpoint}-left { text-align: left !important; }
.text-#{$breakpoint}-right { text-align: right !important; }
.text-#{$breakpoint}-center { text-align: center !important; }
}
}
// Transformation
.text-lowercase { text-transform: lowercase !important; }
.text-uppercase { text-transform: uppercase !important; }
.text-capitalize { text-transform: capitalize !important; }
// Weight and italics
.font-weight-normal { font-weight: normal; }
.font-weight-bold { font-weight: bold; }
.font-italic { font-style: italic; }
// Contextual colors
.text-muted {
color: $text-muted;
}
@include text-emphasis-variant('.text-primary', $brand-primary);
@include text-emphasis-variant('.text-success', $brand-success);
@include text-emphasis-variant('.text-info', $brand-info);
@include text-emphasis-variant('.text-warning', $brand-warning);
@include text-emphasis-variant('.text-danger', $brand-danger);
// Misc
.text-hide {
@include text-hide();
}

View File

@ -1,7 +1,13 @@
//
// Responsive utilities
// Visibility utilities
//
.invisible {
visibility: hidden !important;
}
// Responsive visibility utilities
@each $bp in map-keys($grid-breakpoints) {
.hidden-#{$bp}-up {
@include media-breakpoint-up($bp) {