Skip to content

Commit

Permalink
fix(rtl): reset bootstrap default styles (#414)
Browse files Browse the repository at this point in the history
  • Loading branch information
yggg authored and nnixaa committed Jun 15, 2018
1 parent b3adb69 commit 7634df5
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 18 deletions.
88 changes: 72 additions & 16 deletions src/framework/theme/styles/global/bootstrap/_button-group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -97,42 +97,74 @@
@include nb-ltr() {
border-top-left-radius: nb-theme(btn-border-radius);
border-bottom-left-radius: nb-theme(btn-border-radius);
border-top-right-radius: 0;
border-bottom-right-radius: 0;
};
@include nb-rtl() {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
border-top-right-radius: nb-theme(btn-border-radius);
border-bottom-right-radius: nb-theme(btn-border-radius);
};
}
&:last-child {
@include nb-ltr() {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
border-top-right-radius: nb-theme(btn-border-radius);
border-bottom-right-radius: nb-theme(btn-border-radius);
};
@include nb-rtl() {
border-top-left-radius: nb-theme(btn-border-radius);
border-bottom-left-radius: nb-theme(btn-border-radius);
border-top-right-radius: 0;
border-bottom-right-radius: 0;
};
}
}

.btn-group.dropdown {
& > .btn:first-of-type.dropdown-toggle {
@include nb-ltr(border-top-left-radius, nb-theme(btn-border-radius));
@include nb-rtl(border-top-right-radius, nb-theme(btn-border-radius));
@include nb-ltr() {
border-top-left-radius: nb-theme(btn-border-radius);
border-top-right-radius: 0;
};
@include nb-rtl() {
border-top-left-radius: 0;
border-top-right-radius: nb-theme(btn-border-radius);
};
}
& > .btn:last-of-type.dropdown-toggle {
@include nb-ltr(border-top-right-radius, nb-theme(btn-border-radius));
@include nb-rtl(border-top-left-radius, nb-theme(btn-border-radius));
@include nb-ltr() {
border-top-left-radius: 0;
border-top-right-radius: nb-theme(btn-border-radius);
};
@include nb-rtl() {
border-top-left-radius: nb-theme(btn-border-radius);
border-top-right-radius: 0;
};
}

&:not(.show) {
& > .btn:first-of-type.dropdown-toggle {
@include nb-ltr(border-bottom-left-radius, nb-theme(btn-border-radius));
@include nb-rtl(border-bottom-right-radius, nb-theme(btn-border-radius));
@include nb-ltr() {
border-bottom-left-radius: nb-theme(btn-border-radius);
border-bottom-right-radius: 0;
};
@include nb-rtl() {
border-bottom-left-radius: 0;
border-bottom-right-radius: nb-theme(btn-border-radius);
};
}
& > .btn:last-of-type.dropdown-toggle {
@include nb-ltr(border-bottom-right-radius, nb-theme(btn-border-radius));
@include nb-rtl(border-bottom-left-radius, nb-theme(btn-border-radius));
@include nb-ltr() {
border-bottom-left-radius: 0;
border-bottom-right-radius: nb-theme(btn-border-radius);
};
@include nb-rtl() {
border-bottom-left-radius: nb-theme(btn-border-radius);
border-bottom-right-radius: 0;
};
}
}

Expand All @@ -144,22 +176,46 @@

.btn-group.dropup {
& > .btn:first-of-type.dropdown-toggle {
@include nb-ltr(border-bottom-left-radius, nb-theme(btn-border-radius));
@include nb-rtl(border-bottom-right-radius, nb-theme(btn-border-radius));
@include nb-ltr() {
border-bottom-left-radius: nb-theme(btn-border-radius);
border-bottom-right-radius: 0;
};
@include nb-rtl() {
border-bottom-left-radius: 0;
border-bottom-right-radius: nb-theme(btn-border-radius);
};
}
& > .btn:last-of-type.dropdown-toggle {
@include nb-ltr(border-bottom-right-radius, nb-theme(btn-border-radius));
@include nb-rtl(border-bottom-left-radius, nb-theme(btn-border-radius));
@include nb-ltr() {
border-bottom-left-radius: 0;
border-bottom-right-radius: nb-theme(btn-border-radius);
};
@include nb-rtl() {
border-bottom-left-radius: nb-theme(btn-border-radius);
border-bottom-right-radius: 0;
};
}

&:not(.show) {
& > .btn:first-of-type.dropdown-toggle {
@include nb-ltr(border-top-left-radius, nb-theme(btn-border-radius));
@include nb-rtl(border-top-right-radius, nb-theme(btn-border-radius));
@include nb-ltr() {
border-top-left-radius: nb-theme(btn-border-radius);
border-top-right-radius: 0;
};
@include nb-rtl() {
border-top-left-radius: 0;
border-top-right-radius: nb-theme(btn-border-radius);
};
}
& > .btn:last-of-type.dropdown-toggle {
@include nb-ltr(border-top-right-radius, nb-theme(btn-border-radius));
@include nb-rtl(border-top-left-radius, nb-theme(btn-border-radius));
@include nb-ltr() {
border-top-left-radius: 0;
border-top-right-radius: nb-theme(btn-border-radius);
};
@include nb-rtl() {
border-top-left-radius: nb-theme(btn-border-radius);
border-top-right-radius: 0;
};
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

.custom-control-indicator {
background-color: nb-theme(checkbox-bg);
border-radius: 50%;
width: nb-theme(checkbox-size);
height: nb-theme(checkbox-size);
border: nb-theme(checkbox-border-size) solid nb-theme(checkbox-border-color);
Expand Down
18 changes: 16 additions & 2 deletions src/framework/theme/styles/global/bootstrap/_input-group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,14 @@
padding: 0.25rem 1rem;
color: nb-theme(form-control-placeholder-color);

@include nb-ltr(border-right, none);
@include nb-rtl(border-left, none);
@include nb-ltr() {
border-left: $form-control-border;
border-right: none;
};
@include nb-rtl() {
border-left: none;
border-right: $form-control-border;
};
}

.input-group-addon {
Expand Down Expand Up @@ -55,12 +61,16 @@
.input-group-prepend .btn:first-child,
.input-group-btn .btn:first-child {
@include nb-ltr() {
border-top-left-radius: nb-theme(form-control-border-radius);
border-bottom-left-radius: nb-theme(form-control-border-radius);
border-top-right-radius: 0;
border-bottom-right-radius: 0;
};
@include nb-rtl() {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
border-top-right-radius: nb-theme(form-control-border-radius);
border-bottom-right-radius: nb-theme(form-control-border-radius);
};
}
.form-control:last-child:not(:only-child),
Expand All @@ -70,8 +80,12 @@
@include nb-ltr() {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
border-top-right-radius: nb-theme(form-control-border-radius);
border-bottom-right-radius: nb-theme(form-control-border-radius);
};
@include nb-rtl() {
border-top-left-radius: nb-theme(form-control-border-radius);
border-bottom-left-radius: nb-theme(form-control-border-radius);
border-top-right-radius: 0;
border-bottom-right-radius: 0;
};
Expand Down

0 comments on commit 7634df5

Please sign in to comment.