Skip to content

Commit

Permalink
add bootstrap scss
Browse files Browse the repository at this point in the history
  • Loading branch information
pehaa committed Jun 30, 2020
1 parent be15a92 commit 7d909df
Show file tree
Hide file tree
Showing 78 changed files with 7,724 additions and 0 deletions.
51 changes: 51 additions & 0 deletions scss/_alert.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
//
// Base styles
//

.alert {
position: relative;
padding: $alert-padding-y $alert-padding-x;
margin-bottom: $alert-margin-bottom;
border: $alert-border-width solid transparent;
@include border-radius($alert-border-radius);
}

// Headings for larger alerts
.alert-heading {
// Specified to prevent conflicts of changing $headings-color
color: inherit;
}

// Provide class for links that match alerts
.alert-link {
font-weight: $alert-link-font-weight;
}


// Dismissible alerts
//
// Expand the right padding and account for the close button's positioning.

.alert-dismissible {
padding-right: $close-font-size + $alert-padding-x * 2;

// Adjust close link position
.close {
position: absolute;
top: 0;
right: 0;
padding: $alert-padding-y $alert-padding-x;
color: inherit;
}
}


// scss-docs-start alert-modifiers
// Generate contextual modifier classes for colorizing the alert.

@each $color, $value in $theme-colors {
.alert-#{$color} {
@include alert-variant(color-level($value, $alert-bg-level), color-level($value, $alert-border-level), color-level($value, $alert-color-level));
}
}
// scss-docs-end alert-modifiers
29 changes: 29 additions & 0 deletions scss/_badge.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Base class
//
// Requires one of the contextual, color modifier classes for `color` and
// `background-color`.

.badge {
display: inline-block;
padding: $badge-padding-y $badge-padding-x;
@include font-size($badge-font-size);
font-weight: $badge-font-weight;
line-height: 1;
color: $badge-color;
text-align: center;
white-space: nowrap;
vertical-align: baseline;
@include border-radius($badge-border-radius);
@include gradient-bg();

// Empty badges collapse automatically
&:empty {
display: none;
}
}

// Quick fix for badges in buttons
.btn .badge {
position: relative;
top: -1px;
}
30 changes: 30 additions & 0 deletions scss/_breadcrumb.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.breadcrumb {
display: flex;
flex-wrap: wrap;
padding: $breadcrumb-padding-y $breadcrumb-padding-x;
margin-bottom: $breadcrumb-margin-bottom;
@include font-size($breadcrumb-font-size);
list-style: none;
background-color: $breadcrumb-bg;
@include border-radius($breadcrumb-border-radius);
}

.breadcrumb-item {
display: flex;

// The separator between breadcrumbs (by default, a forward-slash: "/")
+ .breadcrumb-item {
padding-left: $breadcrumb-item-padding-x;

&::before {
display: inline-block; // Suppress underlining of the separator
padding-right: $breadcrumb-item-padding-x;
color: $breadcrumb-divider-color;
content: escape-svg($breadcrumb-divider);
}
}

&.active {
color: $breadcrumb-active-color;
}
}
141 changes: 141 additions & 0 deletions scss/_button-group.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
// stylelint-disable selector-no-qualifying-type

// Make the div behave like a button
.btn-group,
.btn-group-vertical {
position: relative;
display: inline-flex;
vertical-align: middle; // match .btn alignment given font-size hack above

> .btn {
position: relative;
flex: 1 1 auto;
}

// Bring the hover, focused, and "active" buttons to the front to overlay
// the borders properly
> .btn-check:checked + .btn,
> .btn-check:focus + .btn,
> .btn:hover,
> .btn:focus,
> .btn:active,
> .btn.active {
z-index: 1;
}
}

// Optional: Group multiple button groups together for a toolbar
.btn-toolbar {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;

.input-group {
width: auto;
}
}

.btn-group {
// Prevent double borders when buttons are next to each other
> .btn:not(:first-child),
> .btn-group:not(:first-child) {
margin-left: -$btn-border-width;
}

// Reset rounded corners
> .btn:not(:last-child):not(.dropdown-toggle),
> .btn-group:not(:last-child) > .btn {
@include border-right-radius(0);
}

// The left radius should be 0 if the button is:
// - the "third or more" child
// - the second child and the previous element isn't `.btn-check` (making it the first child visually)
// - part of a btn-group which isn't the first child
> .btn:nth-child(n + 3),
> :not(.btn-check) + .btn,
> .btn-group:not(:first-child) > .btn {
@include border-left-radius(0);
}
}

// Sizing
//
// Remix the default button sizing classes into new ones for easier manipulation.

.btn-group-sm > .btn { @extend .btn-sm; }
.btn-group-lg > .btn { @extend .btn-lg; }


//
// Split button dropdowns
//

.dropdown-toggle-split {
padding-right: $btn-padding-x * .75;
padding-left: $btn-padding-x * .75;

&::after,
.dropup &::after,
.dropright &::after {
margin-left: 0;
}

.dropleft &::before {
margin-right: 0;
}
}

.btn-sm + .dropdown-toggle-split {
padding-right: $btn-padding-x-sm * .75;
padding-left: $btn-padding-x-sm * .75;
}

.btn-lg + .dropdown-toggle-split {
padding-right: $btn-padding-x-lg * .75;
padding-left: $btn-padding-x-lg * .75;
}


// The clickable button for toggling the menu
// Set the same inset shadow as the :active state
.btn-group.show .dropdown-toggle {
@include box-shadow($btn-active-box-shadow);

// Show no shadow for `.btn-link` since it has no other button styles.
&.btn-link {
@include box-shadow(none);
}
}


//
// Vertical button groups
//

.btn-group-vertical {
flex-direction: column;
align-items: flex-start;
justify-content: center;

> .btn,
> .btn-group {
width: 100%;
}

> .btn:not(:first-child),
> .btn-group:not(:first-child) {
margin-top: -$btn-border-width;
}

// Reset rounded corners
> .btn:not(:last-child):not(.dropdown-toggle),
> .btn-group:not(:last-child) > .btn {
@include border-bottom-radius(0);
}

> .btn:not(:first-child),
> .btn-group:not(:first-child) > .btn {
@include border-top-radius(0);
}
}
124 changes: 124 additions & 0 deletions scss/_buttons.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
//
// Base styles
//

.btn {
display: inline-block;
font-family: $btn-font-family;
font-weight: $btn-font-weight;
line-height: $btn-line-height;
color: $body-color;
text-align: center;
text-decoration: if($link-decoration == none, null, none);
white-space: $btn-white-space;
vertical-align: middle;
cursor: if($enable-button-pointers, pointer, null);
user-select: none;
background-color: transparent;
border: $btn-border-width solid transparent;
@include button-size($btn-padding-y, $btn-padding-x, $btn-font-size, $btn-border-radius);
@include transition($btn-transition);

&:hover {
color: $body-color;
text-decoration: if($link-hover-decoration == underline, none, null);
}

.btn-check:focus + &,
&:focus {
outline: 0;
box-shadow: $btn-focus-box-shadow;
}

.btn-check:checked + &,
.btn-check:active + &,
&:active,
&.active {
@include box-shadow($btn-active-box-shadow);

&:focus {
@include box-shadow($btn-focus-box-shadow, $btn-active-box-shadow);
}
}

&:disabled,
&.disabled,
fieldset:disabled & {
pointer-events: none;
opacity: $btn-disabled-opacity;
@include box-shadow(none);
}
}


//
// Alternate buttons
//

@each $color, $value in $theme-colors {
.btn-#{$color} {
@include button-variant($value, $value);
}
}

@each $color, $value in $theme-colors {
.btn-outline-#{$color} {
@include button-outline-variant($value);
}
}


//
// Link buttons
//

// Make a button look and behave like a link
.btn-link {
font-weight: $font-weight-normal;
color: $btn-link-color;
text-decoration: $link-decoration;

&:hover {
color: $btn-link-hover-color;
text-decoration: $link-hover-decoration;
}

&:focus {
text-decoration: $link-hover-decoration;
}

&:disabled,
&.disabled {
color: $btn-link-disabled-color;
}

// No need for an active state here
}


//
// Button Sizes
//

.btn-lg {
@include button-size($btn-padding-y-lg, $btn-padding-x-lg, $btn-font-size-lg, $btn-border-radius-lg);
}

.btn-sm {
@include button-size($btn-padding-y-sm, $btn-padding-x-sm, $btn-font-size-sm, $btn-border-radius-sm);
}


//
// Block button
//

.btn-block {
display: block;
width: 100%;

// Vertically space out multiple block buttons
+ .btn-block {
margin-top: $btn-block-spacing-y;
}
}
Loading

0 comments on commit 7d909df

Please sign in to comment.