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

Add new rounded sizes classes #28011

Merged
merged 12 commits into from
Jan 13, 2019
66 changes: 57 additions & 9 deletions dist/css/bootstrap.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/css/bootstrap.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/bootstrap.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/bootstrap.min.css.map

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions scss/mixins/_border-radius.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// stylelint-disable property-blacklist
// Single side border-radius

@mixin border-radius($radius: $border-radius, $fallback-border-radius: false) {
@mixin border-radius($radius: $border-radius, $fallback-border-radius: false, $enable-rounded: $enable-rounded) {
@if $enable-rounded {
border-radius: $radius;
}
Expand All @@ -10,41 +10,41 @@
}
}

@mixin border-top-radius($radius) {
@mixin border-top-radius($radius, $enable-rounded: $enable-rounded) {
@if $enable-rounded {
border-top-left-radius: $radius;
border-top-right-radius: $radius;
}
}

@mixin border-right-radius($radius) {
@mixin border-right-radius($radius, $enable-rounded: $enable-rounded) {
@if $enable-rounded {
border-top-right-radius: $radius;
border-bottom-right-radius: $radius;
}
}

@mixin border-bottom-radius($radius) {
@mixin border-bottom-radius($radius, $enable-rounded: $enable-rounded) {
@if $enable-rounded {
border-bottom-right-radius: $radius;
border-bottom-left-radius: $radius;
}
}

@mixin border-left-radius($radius) {
@mixin border-left-radius($radius, $enable-rounded: $enable-rounded) {
@if $enable-rounded {
border-top-left-radius: $radius;
border-bottom-left-radius: $radius;
}
}

@mixin border-top-right-radius($radius) {
@mixin border-top-right-radius($radius, $enable-rounded: $enable-rounded) {
@if $enable-rounded {
border-top-right-radius: $radius;
}
}

@mixin border-bottom-left-radius($radius) {
@mixin border-bottom-left-radius($radius, $enable-rounded: $enable-rounded) {
@if $enable-rounded {
border-bottom-left-radius: $radius;
}
Expand Down
45 changes: 36 additions & 9 deletions scss/utilities/_borders.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,50 @@
//

.rounded {
border-radius: $border-radius !important;
$enable-rounded: true;
@include border-radius($border-radius, $enable-rounded: true);
&.rounded-sm {
@include border-radius($border-radius-sm, $enable-rounded: true);
}
&.rounded-lg {
@include border-radius($border-radius-lg, $enable-rounded: true);
}
}
.rounded-top {
border-top-left-radius: $border-radius !important;
border-top-right-radius: $border-radius !important;
@include border-top-radius($border-radius, true);
&.rounded-sm {
@include border-top-radius($border-radius-sm, true);
}
&.rounded-lg {
@include border-top-radius($border-radius-lg, true);
}
}
.rounded-right {
border-top-right-radius: $border-radius !important;
border-bottom-right-radius: $border-radius !important;
@include border-right-radius($border-radius, true);
&.rounded-sm {
@include border-right-radius($border-radius-sm, true);
}
&.rounded-lg {
@include border-right-radius($border-radius-lg, true);
}
}
.rounded-bottom {
border-bottom-right-radius: $border-radius !important;
border-bottom-left-radius: $border-radius !important;
@include border-bottom-radius($border-radius, true);
&.rounded-sm {
@include border-bottom-radius($border-radius-sm, true);
}
&.rounded-lg {
@include border-bottom-radius($border-radius-lg, true);
}
}
.rounded-left {
border-top-left-radius: $border-radius !important;
border-bottom-left-radius: $border-radius !important;
@include border-left-radius($border-radius, true);
&.rounded-sm {
@include border-left-radius($border-radius-sm, true);
}
&.rounded-lg {
@include border-left-radius($border-radius-lg, true);
}
}

.rounded-circle {
Expand Down
2 changes: 1 addition & 1 deletion site/docs/4.2/assets/css/docs.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion site/docs/4.2/assets/css/docs.min.css.map

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions site/docs/4.2/utilities/borders.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,17 @@ Add classes to an element to easily round its corners.
<img src="..." alt="..." class="rounded-pill">
<img src="..." alt="..." class="rounded-0">
{% endhighlight %}

## Sizes

Larger or smaller border-radius? Add `.rounded-lg` or `.rounded-sm` for additional sizes.

<div class="bd-example bd-example-images">
{%- include icons/placeholder.svg width="75" height="75" class="rounded rounded-sm" title="Example rounded image" -%}
{%- include icons/placeholder.svg width="75" height="75" class="rounded rounded-lg" title="Example rounded image" -%}
</div>

{% highlight html %}
<img src="..." alt="..." class="rounded rounded-sm">
<img src="..." alt="..." class="rounded rounded-lg">
{% endhighlight %}