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

feature: ✨ RTL logical properties #102

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
39 changes: 17 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,28 +43,29 @@
"cz": "git cz"
},
"devDependencies": {
"@democrance/stylelint-config": "^0.4.1",
"autoprefixer": "^10.4.13",
"commitizen": "^4.2.6",
"concurrently": "^7.6.0",
"@democrance/stylelint-config": "^0.7.0",
"@types/node": "^18.16.8",
"autoprefixer": "^10.4.14",
"commitizen": "^4.3.0",
"concurrently": "^8.0.1",
"cross-env": "^7.0.3",
"csso-cli": "^4.0.1",
"csso-cli": "^4.0.2",
"cz-conventional-changelog": "^3.3.0",
"cz-emoji": "1.3.1",
"find-unused-sass-variables": "^4.0.5",
"husky": "^8.0.2",
"lerna": "^6.3.0",
"lint-staged": "^13.1.0",
"postcss": "^8.4.20",
"find-unused-sass-variables": "^5.0.0",
"husky": "^8.0.3",
"lerna": "^6.6.2",
"lint-staged": "^13.2.2",
"postcss": "^8.4.23",
"postcss-cli": "^10.1.0",
"postcss-csso": "^6.0.1",
"postcss-sass": "^0.5.0",
"postcss-scss": "^4.0.6",
"prettier": "^2.8.1",
"rimraf": "^3.0.2",
"rtlcss": "^4.0.0",
"sass": "^1.57.1",
"stylelint": "^14.16.0",
"prettier": "^2.8.8",
"rimraf": "^5.0.0",
"rtlcss": "^4.1.0",
"sass": "^1.62.1",
"stylelint": "^15.6.1",
"sugarss": "^4.0.1"
},
"publishConfig": {
Expand All @@ -77,13 +78,7 @@
"node-gyp"
],
"overrides": {
"@npmcli/move-file": "npm:@npmcli/fs@latest",
"ansi-regex": "^5.0.1",
"read-package-tree": "npm:@npmcli/arborist@latest",
"readdir-scoped-modules": "npm:@npmcli/fs@latest",
"string-width": "^4.0.0",
"stylelint": "^14.0.0",
"uuid": "^8.0.0"
"@npmcli/move-file": "npm:@npmcli/fs@latest"
}
}
}
2 changes: 1 addition & 1 deletion packages/buefy/scss/components/carousel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ $-css-vars-map: (
}
.indicator-item {
&:not(:last-child) {
margin-right: var(--carousel-indicator-spaced);
@include bulma-utilities.ltr-property("margin", var(--carousel-indicator-spaced));
}
&.is-active .indicator-style,
.indicator-style:hover {
Expand Down
6 changes: 3 additions & 3 deletions packages/buefy/scss/components/checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ $-css-vars-map: (
align-items: center;
outline: none;
&:not(.button) {
margin-right: 0.5em;
@include bulma-utilities.ltr-property("margin", 0.5em);
& + .checkbox:last-child {
margin-right: 0;
@include bulma-utilities.ltr-property("margin", 0);
}
}
input[type=checkbox] {
Expand Down Expand Up @@ -114,7 +114,7 @@ $-css-vars-map: (
}
}
.control-label {
padding-left: var(--checkbox-padding);
@include bulma-utilities.ltr-property("padding", var(--checkbox-padding), false);
}
&.button {
display: flex;
Expand Down
3 changes: 1 addition & 2 deletions packages/buefy/scss/components/clockpicker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@ $-css-vars-map: (
}

.card-header {
border-top-left-radius: var(--clockpicker-card-radius);
border-top-right-radius: var(--clockpicker-card-radius);
@include bulma-utilities.lph-border-radius(top, var(--clockpicker-card-radius));
}

.card-content {
Expand Down
8 changes: 4 additions & 4 deletions packages/buefy/scss/components/colorpicker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ $-css-vars-map: (
flex-grow: 1;

.field-label {
margin-right: .5rem;
@include bulma-utilities.ltr-property("margin", .5rem);
}
.control {
display: flex;
Expand All @@ -43,7 +43,7 @@ $-css-vars-map: (
-webkit-appearance: none;
-moz-appearance: textfield;
appearance: textfield;
text-align: right;
text-align: end;

&::-webkit-outer-spin-button,
&::-webkit-inner-spin-button {
Expand All @@ -65,10 +65,10 @@ $-css-vars-map: (

.colorpicker-footer {
padding-top: 0;
padding-left: .875rem;
border-width: 0 0 0 1px;
margin-top: 0;
margin-left: .875rem;
@include bulma-utilities.ltr-property("margin", 0.875rem, false);
@include bulma-utilities.ltr-property("padding", 0.875rem, false);
}
}
}
Expand Down
16 changes: 6 additions & 10 deletions packages/buefy/scss/components/datepicker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,8 @@ $-css-vars-map: (
&.is-within-hovered-range {
&.is-first-hovered {
background-color: var(--grey);
border-bottom-right-radius: 0;
border-top-right-radius: 0;
color: var(--grey-lighter);
@include bulma-utilities.lph-border-radius(right, 0);
}
&.is-within-hovered {
border-radius: 0;
Expand All @@ -143,9 +142,8 @@ $-css-vars-map: (
}
&.is-last-hovered {
background-color: var(--grey);
border-bottom-left-radius: 0;
border-top-left-radius: 0;
color: var(--grey-lighter);
@include bulma-utilities.lph-border-radius(left, 0);
}
}
}
Expand All @@ -154,9 +152,8 @@ $-css-vars-map: (
color: var(--datepicker-item-selected-color);
&.is-first-selected {
background-color: var(--datepicker-item-selected-background-color);
border-bottom-right-radius: 0;
border-top-right-radius: 0;
color: var(--datepicker-item-selected-color);
@include bulma-utilities.lph-border-radius(right, 0);
}
&.is-within-selected {
--datepicker-item-selected-background-color: #{bulma-utilities.bulmaVarOpacity(primary, 0.5)};
Expand All @@ -165,9 +162,8 @@ $-css-vars-map: (
}
&.is-last-selected {
background-color: var(--datepicker-item-selected-background-color);
border-bottom-left-radius: 0;
border-top-left-radius: 0;
color: var(--datepicker-item-selected-color);
@include bulma-utilities.lph-border-radius(left, 0);
}
}
&.is-nearby:not(.is-selected) {
Expand Down Expand Up @@ -230,8 +226,8 @@ $-css-vars-map: (
.footer-horizontal-timepicker {
display: flex;
padding-left: 10px;
border: none;
margin-left: 5px;
border:none;
@include bulma-utilities.ltr-property("margin", 0.5em, false);
}
.dropdown-horizontal-timepicker {
display: flex;
Expand Down
3 changes: 1 addition & 2 deletions packages/buefy/scss/components/dialog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
margin-top: 16px;
}
&.is-titleless {
border-top-left-radius: var(--card-radius);
border-top-right-radius: var(--card-radius);
@include bulma-utilities.lph-border-radius(top, var(--card-radius));
}
}
.modal-card-foot {
Expand Down
4 changes: 2 additions & 2 deletions packages/buefy/scss/components/dropdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ $-css-vars-map: (

.dropdown {
& + .dropdown {
margin-left: 0.5em;
@include bulma-utilities.ltr-property("margin", 0.5em, false);
}
.background {
@extend %overlay;
Expand Down Expand Up @@ -47,7 +47,7 @@ $-css-vars-map: (
}
.has-link a {
@extend .dropdown-item;
padding-right: 3rem;
@include bulma-utilities.ltr-property("padding", 3rem);
white-space: nowrap;
}
}
Expand Down
45 changes: 20 additions & 25 deletions packages/buefy/scss/components/form.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $-css-vars-map: (
.field {
flex-shrink: 0;
&:not(:last-child) {
margin-right: 0.75rem;
@include bulma-utilities.ltr-property("margin", .75rem);
}
&.is-expanded {
flex-grow: 1;
Expand All @@ -32,16 +32,14 @@ $-css-vars-map: (
.button,
.input,
.select select {
border-bottom-left-radius: var(--input-radius);
border-top-left-radius: var(--input-radius);
@include bulma-utilities.lph-border-radius(left, var(--input-radius));
}
}
&:last-child .control {
.button,
.input,
.select select {
border-bottom-right-radius: var(--input-radius);
border-top-right-radius: var(--input-radius);
@include bulma-utilities.lph-border-radius(right, var(--input-radius));
}
}
.control {
Expand All @@ -60,8 +58,7 @@ $-css-vars-map: (
.button,
.input,
.select select {
border-bottom-left-radius: 0;
border-top-left-radius: 0;
@include bulma-utilities.lph-border-radius(left, 0);
}
}
}
Expand All @@ -70,15 +67,14 @@ $-css-vars-map: (
.button,
.input,
.select select {
border-bottom-right-radius: 0;
border-top-right-radius: 0;
@include bulma-utilities.lph-border-radius(right, 0);
}
}
}
}
&.b-numberinput {
.control {
margin-right: unset;
@include bulma-utilities.ltr-property("margin", unset);
}
}
}
Expand All @@ -104,7 +100,7 @@ $-css-vars-map: (
}
.taginput .counter {
float: none;
text-align: right;
text-align: end;
}

&.has-addons {
Expand All @@ -113,8 +109,7 @@ $-css-vars-map: (
.button,
.input,
.select select {
border-bottom-left-radius: var(--input-radius);
border-top-left-radius: var(--input-radius);
@include bulma-utilities.lph-border-radius(left, var(--input-radius));
}
}
}
Expand All @@ -124,8 +119,7 @@ $-css-vars-map: (
&.is-floating-label {
.label {
top: -0.775em;
padding-right: 0.125em;
padding-left: 0.125em;
padding-inline: 0.125em;
&::before {
position: absolute;
z-index: -1;
Expand Down Expand Up @@ -239,44 +233,45 @@ $-css-vars-map: (
}
}
}
&.is-floating-label, &.is-floating-in-label {
&.is-floating-label,
&.is-floating-in-label {
&.has-numberinput {
.label {
margin-left: calc(var(--size-normal) * 3);
@include bulma-utilities.ltr-property("margin", calc(var(--size-normal) * 3), false);
}
&.has-numberinput-is-small {
.label {
margin-left: calc(var(--size-small) * 3);
@include bulma-utilities.ltr-property("margin", calc(var(--size-small) * 3), false);
}
}
&.has-numberinput-is-medium {
.label {
margin-left: calc(var(--size-medium) * 3);
@include bulma-utilities.ltr-property("margin", calc(var(--size-medium) * 3), false);
}
}
&.has-numberinput-is-large {
.label {
margin-left: calc(var(--size-large) * 3);
@include bulma-utilities.ltr-property("margin", calc(var(--size-large) * 3), false);
}
}
}
&.has-numberinput-compact {
.label {
margin-left: calc(var(--size-normal) * 2.25);
@include bulma-utilities.ltr-property("margin", calc(var(--size-normal) * 2.25), false);
}
&.has-numberinput-is-small {
.label {
margin-left: calc(var(--size-small) * 2.25);
@include bulma-utilities.ltr-property("margin", calc(var(--size-small) * 2.25), false);
}
}
&.has-numberinput-is-medium {
.label {
margin-left: calc(var(--size-medium) * 2.25);
@include bulma-utilities.ltr-property("margin", calc(var(--size-medium) * 2.25), false);
}
}
&.has-numberinput-is-large {
.label {
margin-left: calc(var(--size-large) * 2.25);
@include bulma-utilities.ltr-property("margin", calc(var(--size-large) * 2.25), false);
}
}
}
Expand All @@ -299,8 +294,8 @@ $-css-vars-map: (

.control {
.help.counter {
margin-left: 0.5em;
float: right;
@include bulma-utilities.ltr-property("margin", 0.5em, false);
}
.icon {
&.is-clickable {
Expand Down
6 changes: 4 additions & 2 deletions packages/buefy/scss/components/navbar.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
@use "../../../bulma/sass/utilities" as bulma-utilities;

.navbar {
&.has-navbar-centered {
.navbar-start {
justify-content: center;
margin-left: auto;
@include bulma-utilities.ltr-property("margin", auto, false);
}

.navbar-end {
margin-left: 0;
@include bulma-utilities.ltr-property("margin", 0, false);
}
}

Expand Down
Loading