Commit 0dd10e46 authored by Nikolay Gromov's avatar Nikolay Gromov

Добавил доступности для field-toggler

parent 12d6d9cd
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
}], }],
"at-rule-empty-line-before": ["always", { "at-rule-empty-line-before": ["always", {
"message": "Перед @-правилами строку пустую оставь (кроме @import и @include)", "message": "Перед @-правилами строку пустую оставь (кроме @import и @include)",
ignoreAtRules: ["import", "include"], ignoreAtRules: ["import", "include", "function", "return", "if", "else"],
ignore: ["after-comment"] ignore: ["after-comment"]
}], }],
"at-rule-name-case": ["lower", { "at-rule-name-case": ["lower", {
...@@ -269,6 +269,8 @@ ...@@ -269,6 +269,8 @@
"/^include/", "/^include/",
"/^if/", "/^if/",
"/^else/", "/^else/",
"/^function/",
"/^return/",
] ]
}], }],
"at-rule-no-vendor-prefix": [true, { "at-rule-no-vendor-prefix": [true, {
......
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
"addCssBefore": [ "addCssBefore": [
"./src/scss/variables.scss", "./src/scss/variables.scss",
"./src/scss/mixins.scss", "./src/scss/mixins.scss",
"./src/scss/functions.scss",
"../../node_modules/owl.carousel/dist/assets/owl.carousel.css", "../../node_modules/owl.carousel/dist/assets/owl.carousel.css",
"../../node_modules/nouislider/distribute/nouislider.css" "../../node_modules/nouislider/distribute/nouislider.css"
], ],
...@@ -84,4 +85,4 @@ ...@@ -84,4 +85,4 @@
"buildPath": "./build/", "buildPath": "./build/",
"blocksDirName": "blocks" "blocksDirName": "blocks"
} }
} }
\ No newline at end of file
...@@ -41,20 +41,24 @@ $line-height: 1.375em !default; ...@@ -41,20 +41,24 @@ $line-height: 1.375em !default;
position: absolute; position: absolute;
top: 0.6em; top: 0.6em;
left: 0; left: 0;
width: 2.6em; width: px-to-em(35);
height: 1.2em; height: px-to-em(18);
transform: translateY(-50%); transform: translateY(-50%);
background-color: #fff; background-color: #fff;
border: 1px solid $border-color; border: 1px solid $border-color;
@at-root input:focus ~ & {
@include field-focus;
}
} }
&:after { &:after {
content: ''; content: '';
position: absolute; position: absolute;
top: 0.6em; top: 0.6em;
left: 0; left: 2px;
width: 1.2em; width: px-to-em(14);
height: 1.2em; height: px-to-em(14);
transform: translateY(-50%); transform: translateY(-50%);
background-color: $gray-lightest; background-color: $gray-lightest;
border: 1px solid $border-color; border: 1px solid $border-color;
...@@ -62,7 +66,7 @@ $line-height: 1.375em !default; ...@@ -62,7 +66,7 @@ $line-height: 1.375em !default;
} }
@at-root input:checked ~ &:after { @at-root input:checked ~ &:after {
transform: translate(1.4em, -50%); transform: translate(px-to-em(17), -50%);
} }
} }
...@@ -72,12 +76,7 @@ $line-height: 1.375em !default; ...@@ -72,12 +76,7 @@ $line-height: 1.375em !default;
left: 0; left: 0;
width: 0; width: 0;
height: 0; height: 0;
visibility: hidden; opacity: 0;
&:focus,
&:active {
@include field-focus;
}
} }
&__help-text-wrap { &__help-text-wrap {
......
/**
* Преобразование пикселей в em на основе переменной с базовым размером шрифта
* (указывается в px) проекта.
* @param {number} $px Число без единиц измерения, кол-во пикселей
* @param {string} $font-size Число пикселей, размер конт. шрифта на проекте
* @return {string} Результат преобразования $px в em на основе $font-size
*/
@function px-to-em($px, $font-size: $font-size) {
@return (($px * 100 / ($font-size / 1px)) / 100) * 1em;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment