Skip to content

Commit

Permalink
Merge branch 'main' into main-xmr-meteor
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Oct 31, 2020
2 parents b1f87b5 + b63066d commit a5ebfba
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 34 deletions.
4 changes: 2 additions & 2 deletions js/tests/unit/toast.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ describe('Toast', () => {
})

describe('getInstance', () => {
it('should return collapse instance', () => {
it('should return a toast instance', () => {
fixtureEl.innerHTML = '<div></div>'

const div = fixtureEl.querySelector('div')
Expand All @@ -390,7 +390,7 @@ describe('Toast', () => {
expect(Toast.getInstance(div)).toEqual(toast)
})

it('should return null when there is no collapse instance', () => {
it('should return null when there is no toast instance', () => {
fixtureEl.innerHTML = '<div></div>'

const div = fixtureEl.querySelector('div')
Expand Down
9 changes: 5 additions & 4 deletions scss/_utilities.scss
Original file line number Diff line number Diff line change
Expand Up @@ -497,11 +497,12 @@ $utilities: map-merge(
class: rounded,
values: (
null: $border-radius,
sm: $border-radius-sm,
lg: $border-radius-lg,
circle: 50%,
pill: $rounded-pill,
0: 0,
1: $border-radius-sm,
2: $border-radius,
3: $border-radius-lg,
circle: 50%,
pill: $border-radius-pill
)
),
"rounded-top": (
Expand Down
12 changes: 6 additions & 6 deletions scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -345,11 +345,6 @@ $container-padding-x: $grid-gutter-width !default;
// Define common padding and border radius sizes and more.

$border-width: 1px !default;
$border-color: $gray-300 !default;

$border-radius: .25rem !default;
$border-radius-sm: .2rem !default;
$border-radius-lg: .3rem !default;
$border-widths: (
0: 0,
1: 1px,
Expand All @@ -359,7 +354,12 @@ $border-widths: (
5: 5px
) !default;

$rounded-pill: 50rem !default;
$border-color: $gray-300 !default;

$border-radius: .25rem !default;
$border-radius-sm: .2rem !default;
$border-radius-lg: .3rem !default;
$border-radius-pill: 50rem !default;

$box-shadow: 0 .5rem 1rem rgba($black, .15) !default;
$box-shadow-sm: 0 .125rem .25rem rgba($black, .075) !default;
Expand Down
21 changes: 14 additions & 7 deletions scss/forms/_form-control.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Textual form controls
// General form controls (plus a few specific high-level interventions)
//

.form-control {
Expand Down Expand Up @@ -207,13 +207,20 @@ textarea {

.form-control-color {
max-width: 3rem;
height: auto; // Override fixed browser height
padding: $input-padding-y;
}

.form-control-color::-moz-color-swatch {
@include border-radius($input-border-radius);
}
&:not(:disabled):not([readonly]) {
cursor: pointer;
}

&::-moz-color-swatch {
height: if(unit($input-line-height) == "", $input-line-height * 1em, $input-line-height);
@include border-radius($input-border-radius);
}

.form-control-color::-webkit-color-swatch {
@include border-radius($input-border-radius);
&::-webkit-color-swatch {
height: if(unit($input-line-height) == "", $input-line-height * 1em, $input-line-height);
@include border-radius($input-border-radius);
}
}
4 changes: 2 additions & 2 deletions site/content/docs/5.0/components/badge.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Use our background utility classes to quickly change the appearance of a badge.
{{< example >}}
{{< badge.inline >}}
{{- range (index $.Site.Data "theme-colors") }}
<span class="badge bg-{{ .name }}{{ if or (eq .name "light") (eq .name "warning") (eq .name "info") }} text-dark{{ end }}">{{ .name | title }}</span>{{- end -}}
<span class="badge bg-{{ .name }}{{ with .contrast_color }} text-{{ . }}{{ end }}">{{ .name | title }}</span>{{- end -}}
{{< /badge.inline >}}
{{< /example >}}

Expand All @@ -60,6 +60,6 @@ Use the `.rounded-pill` utility class to make badges more rounded with a larger
{{< example >}}
{{< badge.inline >}}
{{- range (index $.Site.Data "theme-colors") }}
<span class="badge rounded-pill bg-{{ .name }}{{ if or (eq .name "light") (eq .name "warning") (eq .name "info") }} text-dark{{ end }}">{{ .name | title }}</span>{{- end -}}
<span class="badge rounded-pill bg-{{ .name }}{{ with .contrast_color }} text-{{ . }}{{ end }}">{{ .name | title }}</span>{{- end -}}
{{< /badge.inline >}}
{{< /example >}}
4 changes: 2 additions & 2 deletions site/content/docs/5.0/components/card.md
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ Use [text and background utilities]({{< docsref "/utilities/colors" >}}) to chan
{{< example >}}
{{< card.inline >}}
{{- range (index $.Site.Data "theme-colors") }}
<div class="card{{ if (eq .name "info") }} text-body{{ else if not (or (eq .name "light") (eq .name "warning") (eq .name "info")) }} text-white{{ end }} bg-{{ .name }} mb-3" style="max-width: 18rem;">
<div class="card{{ if .contrast_color }} text-{{ .contrast_color }}{{ else }} text-white{{ end }} bg-{{ .name }} mb-3" style="max-width: 18rem;">
<div class="card-header">Header</div>
<div class="card-body">
<h5 class="card-title">{{ .name | title }} card title</h5>
Expand All @@ -446,7 +446,7 @@ Use [border utilities]({{< docsref "/utilities/borders" >}}) to change just the
{{- range (index $.Site.Data "theme-colors") }}
<div class="card border-{{ .name }} mb-3" style="max-width: 18rem;">
<div class="card-header">Header</div>
<div class="card-body{{ if not (or (eq .name "light") (eq .name "warning") (eq .name "info")) }} text-{{ .name }}{{ end }}">
<div class="card-body{{ if not .contrast_color }} text-{{ .name }}{{ end }}">
<h5 class="card-title">{{ .name | title }} card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion site/content/docs/5.0/customize/color.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ We use a subset of all colors to create a smaller color palette for generating c
{{< theme-colors.inline >}}
{{- range (index $.Site.Data "theme-colors") }}
<div class="col-md-4">
<div class="p-3 mb-3 bg-{{ .name }} {{ if or (eq .name "light") (eq .name "warning") (eq .name "info") }}text-dark{{ else if (eq .name "info")}}text-body{{ else }}text-white{{ end }}">{{ .name | title }}</div>
<div class="p-3 mb-3 bg-{{ .name }} {{ if .contrast_color }}text-{{ .contrast_color }}{{ else }}text-white{{ end }}">{{ .name | title }}</div>
</div>
{{ end -}}
{{< /theme-colors.inline >}}
Expand Down
1 change: 1 addition & 0 deletions site/content/docs/5.0/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ toc: true
- The longstanding [Missing border radius on input group with validation feedback bug](https://github.com/twbs/bootstrap/issues/25110) is finally fixed by adding an additional `.has-validation` class to input groups with validation.
- Promoted the Floating labels example to fully supported form component. [See the new Floating labels page.]({{< docsref "/forms/floating-labels" >}})
- File inputs now use the `.form-control` class and don't require JavaScript, additional HTML, or additional classes. [See #31955](https://github.com/twbs/bootstrap/pull/31955).
- Added `cursor:pointer` to `.form-control-color` color inputs.

### Utilities

Expand Down
14 changes: 7 additions & 7 deletions site/content/docs/5.0/utilities/borders.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Change the border color using utilities built on our theme colors.
<span class="border border-white"></span>
{{< /example >}}

### Border-width
## Border-width

{{< example class="bd-example-border-utils" >}}
<span class="border border-1"></span>
Expand All @@ -65,15 +65,15 @@ Add classes to an element to easily round its corners.
{{< placeholder width="75" height="75" class="rounded-left" title="Example left rounded image" >}}
{{< placeholder width="75" height="75" class="rounded-circle" title="Completely round image" >}}
{{< placeholder width="150" height="75" class="rounded-pill" title="Rounded pill image" >}}
{{< placeholder width="75" height="75" class="rounded-0" title="Example non-rounded image (overrides rounding applied elsewhere)" >}}
{{< /example >}}

### Sizes

## Sizes

Use `.rounded-lg` or `.rounded-sm` for larger or smaller border-radius.
Use the scaling classes for larger or smaller rounded corners. Sizes range from `0` to `3`, and can be configured by modifying the utilities API.

{{< example class="bd-example-rounded-utils" >}}
{{< placeholder width="75" height="75" class="rounded-sm" title="Example small rounded image" >}}
{{< placeholder width="75" height="75" class="rounded-lg" title="Example large rounded image" >}}
{{< placeholder width="75" height="75" class="rounded-0" title="Example non-rounded image" >}}
{{< placeholder width="75" height="75" class="rounded-1" title="Example small rounded image" >}}
{{< placeholder width="75" height="75" class="rounded-2" title="Example default rounded image" >}}
{{< placeholder width="75" height="75" class="rounded-3" title="Example large rounded image" >}}
{{< /example >}}
6 changes: 3 additions & 3 deletions site/content/docs/5.0/utilities/colors.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Colorize text with color utilities. If you want to colorize links, you can use t
{{< example >}}
{{< colors.inline >}}
{{- range (index $.Site.Data "theme-colors") }}
<p class="text-{{ .name }}{{ if or (eq .name "light") (eq .name "warning") (eq .name "info") }} bg-dark{{ end }}">.text-{{ .name }}</p>
<p class="text-{{ .name }}{{ with .contrast_color }} bg-{{ . }}{{ end }}">.text-{{ .name }}</p>
{{- end -}}
{{< /colors.inline >}}
<p class="text-body">.text-body</p>
Expand All @@ -40,7 +40,7 @@ Similar to the contextual text color classes, easily set the background of an el
{{< example >}}
{{< colors.inline >}}
{{- range (index $.Site.Data "theme-colors") }}
<div class="p-3 mb-2 bg-{{ .name }} {{ if or (eq .name "light") (eq .name "warning") (eq .name "info") }}text-dark{{ else if (eq .name "info") }}text-body{{ else }}text-white{{ end }}">.bg-{{ .name }}</div>
<div class="p-3 mb-2 bg-{{ .name }}{{ if .contrast_color }} text-{{ .contrast_color }}{{ else }} text-white{{ end }}">.bg-{{ .name }}</div>
{{- end -}}
{{< /colors.inline >}}
<div class="p-3 mb-2 bg-white text-dark">.bg-white</div>
Expand All @@ -56,7 +56,7 @@ Do you need a gradient in your custom CSS? Just add `background-image: var(--bs-
{{< markdown >}}
{{< colors.inline >}}
{{- range (index $.Site.Data "theme-colors") }}
<div class="p-3 mb-2 bg-{{ .name }} bg-gradient {{ if or (eq .name "light") (eq .name "warning") (eq .name "info") }}text-dark{{ else }}text-white{{ end }}">.bg-{{ .name }}.bg-gradient</div>
<div class="p-3 mb-2 bg-{{ .name }} bg-gradient{{ with .contrast_color }} text-{{ . }}{{ else }} text-white{{ end }}">.bg-{{ .name }}.bg-gradient</div>
{{- end -}}
{{< /colors.inline >}}
{{< /markdown >}}
3 changes: 3 additions & 0 deletions site/data/theme-colors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@
hex: "#dc3545"
- name: warning
hex: "#ffc107"
contrast_color: dark
- name: info
hex: "#17a2b8"
contrast_color: dark
- name: light
hex: "#f8f9fa"
contrast_color: dark
- name: dark
hex: "#343a40"

0 comments on commit a5ebfba

Please sign in to comment.