1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-31 00:59:51 +02:00

Add Sass docs (variables, mixins, and loops) to most pages (#32747)

* WIP: Mention variables, mixins, and loops in docs

* Add Sass sections to component pages

* add sass docs for forms and content

* Update buttons.md

* Remove empty mixins sections

* Massive update to utilities and some consistency changes

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
This commit is contained in:
Mark Otto
2021-02-10 19:29:59 -08:00
committed by GitHub
parent e50c11b8c6
commit 4c7a3e8adf
100 changed files with 942 additions and 480 deletions

View File

@@ -1,3 +1,4 @@
// scss-docs-start alert-variant-mixin
@mixin alert-variant($background, $border, $color) {
color: $color;
@include gradient-bg($background);
@@ -7,3 +8,4 @@
color: shade-color($color, 20%);
}
}
// scss-docs-end alert-variant-mixin

View File

@@ -14,6 +14,7 @@
@return $return;
}
// scss-docs-start border-radius-mixins
@mixin border-radius($radius: $border-radius, $fallback-border-radius: false) {
@if $enable-rounded {
border-radius: valid-radius($radius);
@@ -74,3 +75,4 @@
border-bottom-left-radius: valid-radius($radius);
}
}
// scss-docs-end border-radius-mixins

View File

@@ -3,6 +3,7 @@
// Easily pump out default styles, as well as :hover, :focus, :active,
// and disabled options for all buttons
// scss-docs-start btn-variant-mixin
@mixin button-variant(
$background,
$border,
@@ -71,7 +72,9 @@
border-color: $disabled-border;
}
}
// scss-docs-end btn-variant-mixin
// scss-docs-start btn-outline-variant-mixin
@mixin button-outline-variant(
$color,
$color-hover: color-contrast($color),
@@ -118,11 +121,13 @@
background-color: transparent;
}
}
// scss-docs-end btn-outline-variant-mixin
// Button sizes
// scss-docs-start btn-size-mixin
@mixin button-size($padding-y, $padding-x, $font-size, $border-radius) {
padding: $padding-y $padding-x;
@include font-size($font-size);
// Manually declare to provide an override to the browser default
@include border-radius($border-radius, 0);
}
// scss-docs-end btn-size-mixin

View File

@@ -1,3 +1,4 @@
// scss-docs-start caret-mixins
@mixin caret-down {
border-top: $caret-width solid;
border-right: $caret-width solid transparent;
@@ -60,3 +61,4 @@
}
}
}
// scss-docs-end caret-mixins

View File

@@ -1,5 +1,7 @@
// This mixin uses an `if()` technique to be compatible with Dart Sass
// See https://github.com/sass/sass/issues/1873#issuecomment-152293725 for more details
// scss-docs-start form-validation-mixins
@mixin form-validation-state-selector($state) {
@if ($state == "valid" or $state == "invalid") {
.was-validated #{if(&, "&", "")}:#{$state},
@@ -122,3 +124,4 @@
}
}
}
// scss-docs-end form-validation-mixins

View File

@@ -1,5 +1,6 @@
// List Groups
// scss-docs-start list-group-mixin
@mixin list-group-item-variant($state, $background, $color) {
.list-group-item-#{$state} {
color: $color;
@@ -20,3 +21,4 @@
}
}
}
// scss-docs-end list-group-mixin

View File

@@ -1,5 +1,6 @@
// Pagination
// scss-docs-start pagination-mixin
@mixin pagination-size($padding-y, $padding-x, $font-size, $border-radius) {
.page-link {
padding: $padding-y $padding-x;
@@ -27,3 +28,4 @@
}
}
}
// scss-docs-end pagination-mixin