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

feat(RTL): implement RTL

Using RTLCSS directives, renaming things to use logical names and following best practices.
This commit is contained in:
Gaël Poupard
2020-06-26 17:06:20 +03:00
committed by XhmikosR
parent 71ecc3323f
commit 9488978fb5
37 changed files with 301 additions and 200 deletions

View File

@@ -30,7 +30,7 @@
}
}
@mixin border-right-radius($radius: $border-radius) {
@mixin border-end-radius($radius: $border-radius) {
@if $enable-rounded {
border-top-right-radius: valid-radius($radius);
border-bottom-right-radius: valid-radius($radius);
@@ -44,32 +44,32 @@
}
}
@mixin border-left-radius($radius: $border-radius) {
@mixin border-start-radius($radius: $border-radius) {
@if $enable-rounded {
border-top-left-radius: valid-radius($radius);
border-bottom-left-radius: valid-radius($radius);
}
}
@mixin border-top-left-radius($radius: $border-radius) {
@mixin border-top-start-radius($radius: $border-radius) {
@if $enable-rounded {
border-top-left-radius: valid-radius($radius);
}
}
@mixin border-top-right-radius($radius: $border-radius) {
@mixin border-top-end-radius($radius: $border-radius) {
@if $enable-rounded {
border-top-right-radius: valid-radius($radius);
}
}
@mixin border-bottom-right-radius($radius: $border-radius) {
@mixin border-bottom-end-radius($radius: $border-radius) {
@if $enable-rounded {
border-bottom-right-radius: valid-radius($radius);
}
}
@mixin border-bottom-left-radius($radius: $border-radius) {
@mixin border-bottom-start-radius($radius: $border-radius) {
@if $enable-rounded {
border-bottom-left-radius: valid-radius($radius);
}

View File

@@ -12,14 +12,14 @@
border-left: $caret-width solid transparent;
}
@mixin caret-right {
@mixin caret-end {
border-top: $caret-width solid transparent;
border-right: 0;
border-bottom: $caret-width solid transparent;
border-left: $caret-width solid;
}
@mixin caret-left {
@mixin caret-start {
border-top: $caret-width solid transparent;
border-right: $caret-width solid;
border-bottom: $caret-width solid transparent;
@@ -36,12 +36,12 @@
@include caret-down();
} @else if $direction == up {
@include caret-up();
} @else if $direction == right {
@include caret-right();
} @else if $direction == end {
@include caret-end();
}
}
@if $direction == left {
@if $direction == start {
&::after {
display: none;
}
@@ -51,7 +51,7 @@
margin-right: $caret-spacing;
vertical-align: $caret-vertical-align;
content: "";
@include caret-left();
@include caret-start();
}
}

View File

@@ -79,7 +79,7 @@
border-color: $color;
@if $enable-validation-icons {
padding-right: $form-select-feedback-icon-padding-right;
padding-right: $form-select-feedback-icon-padding-end;
background-image: escape-svg($form-select-indicator), escape-svg($icon);
background-position: $form-select-bg-position, $form-select-feedback-icon-position;
background-size: $form-select-bg-size, $form-select-feedback-icon-size;

View File

@@ -7,16 +7,16 @@
}
.page-item {
@if $pagination-margin-left == (-$pagination-border-width) {
@if $pagination-margin-start == (-$pagination-border-width) {
&:first-child {
.page-link {
@include border-left-radius($border-radius);
@include border-start-radius($border-radius);
}
}
&:last-child {
.page-link {
@include border-right-radius($border-radius);
@include border-end-radius($border-radius);
}
}
} @else {

View File

@@ -41,7 +41,12 @@
}
}
$is-rtl: map-get($utility, rtl);
@if $value != null {
@if $is-rtl == false {
/* rtl:begin:remove */
}
.#{$property-class + $infix + $property-class-modifier} {
@each $property in $properties {
#{$property}: $value if($enable-important-utilities, !important, null);
@@ -55,6 +60,9 @@
}
}
}
@if $is-rtl == false {
/* rtl:end:remove */
}
}
}
}