Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
K
kpp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alexandr Veselov
kpp
Commits
e787f439
Commit
e787f439
authored
Nov 19, 2017
by
Nikolay Gromov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Радиокнопки и чекбоксы: сделал без картинок, доступными с клавиатуры
parent
aee4bce5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
11 deletions
+51
-11
field-checkbox.scss
src/blocks/field-checkbox/field-checkbox.scss
+42
-7
field-radio.scss
src/blocks/field-radio/field-radio.scss
+9
-4
No files found.
src/blocks/field-checkbox/field-checkbox.scss
View file @
e787f439
...
@@ -36,7 +36,8 @@ $line-height: 1.375em !default;
...
@@ -36,7 +36,8 @@ $line-height: 1.375em !default;
&
__name-text
{
&
__name-text
{
// свой чекбокс
// свой чекбокс с картинкой
// &:before {
// &:before {
// content: '';
// content: '';
// position: absolute;
// position: absolute;
...
@@ -50,6 +51,45 @@ $line-height: 1.375em !default;
...
@@ -50,6 +51,45 @@ $line-height: 1.375em !default;
// @at-root input:checked ~ &:before {
// @at-root input:checked ~ &:before {
// background-image: svg-load('../blocks/field-checkbox/img_to_bg/checkbox--checked.svg');
// background-image: svg-load('../blocks/field-checkbox/img_to_bg/checkbox--checked.svg');
// }
// }
// / свой чекбокс с картинкой
// свой чекбокс без картинок
&
:before
{
content
:
''
;
position
:
absolute
;
top
:
0
.1em
;
left
:
0
;
width
:
14px
;
height
:
14px
;
border
:
2px
solid
currentColor
;
border-radius
:
$border-radius
;
}
@at-root
input
:focus
~
&
:before
{
@include
field-focus
;
}
&
:after
{
content
:
''
;
position
:
absolute
;
top
:
calc
(
0
.1em
+
1px
);
left
:
3px
;
width
:
14px
;
height
:
6px
;
opacity
:
0
;
border-left
:
2px
solid
currentColor
;
border-bottom
:
2px
solid
currentColor
;
transform
:
rotate
(
-45deg
);
transition
:
opacity
$transition-time
;
@at-root
input
:checked
~
&
{
opacity
:
1
;
}
}
// / свой чекбокс без картинок
}
}
&
__input
{
&
__input
{
...
@@ -66,12 +106,7 @@ $line-height: 1.375em !default;
...
@@ -66,12 +106,7 @@ $line-height: 1.375em !default;
}
}
// сокрытие инпута в случае использования своего чекбокса
// сокрытие инпута в случае использования своего чекбокса
// top: 0;
opacity
:
0
;
// left: 0;
// width: 0;
// height: 0;
// overflow: hidden;
// visibility: hidden;
}
}
&
__help-text-wrap
{
&
__help-text-wrap
{
...
...
src/blocks/field-radio/field-radio.scss
View file @
e787f439
...
@@ -37,6 +37,7 @@ $line-height: 1.375em !default;
...
@@ -37,6 +37,7 @@ $line-height: 1.375em !default;
&
__name-text
{
&
__name-text
{
// своя радиокнопка с картинкой
// своя радиокнопка с картинкой
// &:before {
// &:before {
// content: '';
// content: '';
// position: absolute;
// position: absolute;
...
@@ -50,9 +51,11 @@ $line-height: 1.375em !default;
...
@@ -50,9 +51,11 @@ $line-height: 1.375em !default;
// @at-root input:checked ~ &:before {
// @at-root input:checked ~ &:before {
// background-image: svg-load('../blocks/field-radio/img_to_bg/radiobutton--checked.svg');
// background-image: svg-load('../blocks/field-radio/img_to_bg/radiobutton--checked.svg');
// }
// }
// / своя радиокнопка с картинкой
// / своя радиокнопка с картинкой
// своя радиокнопка без картинки
// своя радиокнопка без картинки
&
:before
{
&
:before
{
content
:
''
;
content
:
''
;
position
:
absolute
;
position
:
absolute
;
...
@@ -64,6 +67,10 @@ $line-height: 1.375em !default;
...
@@ -64,6 +67,10 @@ $line-height: 1.375em !default;
border-radius
:
50%
;
border-radius
:
50%
;
}
}
@at-root
input
:focus
~
&
:before
{
@include
field-focus
;
}
&
:after
{
&
:after
{
content
:
''
;
content
:
''
;
position
:
absolute
;
position
:
absolute
;
...
@@ -80,6 +87,7 @@ $line-height: 1.375em !default;
...
@@ -80,6 +87,7 @@ $line-height: 1.375em !default;
opacity
:
1
;
opacity
:
1
;
}
}
}
}
// / своя радиокнопка без картинки
// / своя радиокнопка без картинки
}
}
...
@@ -97,10 +105,7 @@ $line-height: 1.375em !default;
...
@@ -97,10 +105,7 @@ $line-height: 1.375em !default;
}
}
// сокрытие инпута в случае использования своей радиокнопки
// сокрытие инпута в случае использования своей радиокнопки
width
:
0
;
opacity
:
0
;
height
:
0
;
overflow
:
hidden
;
visibility
:
hidden
;
}
}
&
__help-text-wrap
{
&
__help-text-wrap
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment