Skip to content

Commit b878c42

Browse files
committed
slider - styles for nav (issue #3) & finite sliding by arrow (issue #6)
1 parent 86643b1 commit b878c42

File tree

5 files changed

+106
-100
lines changed

5 files changed

+106
-100
lines changed

css/components.css

Lines changed: 67 additions & 88 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/components.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

less/slider/_element.less

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
@import "_variables";
2+
@import "../_mixins";
3+
@import "../_themes";
4+
15
.slider {
26
position: relative;
37
.center-horizontal;
@@ -88,6 +92,15 @@
8892
border-radius: @blue-border-radius;
8993
}
9094
}
95+
96+
&--finite {
97+
input[type=radio]:first-of-type:checked ~ .slider__arrows label:last-of-type {
98+
visibility: hidden;
99+
}
100+
input[type=radio]:last-of-type:checked ~ .slider__arrows label:nth-last-of-type(2) {
101+
visibility: hidden;
102+
}
103+
}
91104
}
92105
.create-selector(@pattern, @iterator:1, @count: @max-slides) {
93106
@repeat: ~'@{pattern}';
@@ -103,25 +116,32 @@
103116
})()`;
104117
}
105118
& {
106-
.create-selector('.slider--blue input[type=radio]:nth-of-type( $i ):checked ~ .slider__arrows label:nth-of-type( $imm ),\n.slider--blue input[type=radio]:nth-of-type( $i ):checked ~ .slider__arrows label:nth-of-type( $ipp ),');
119+
.create-selector('.slider input[type=radio]:nth-of-type( $i ):checked ~ .slider__arrows label:nth-of-type( $imm ),\n.slider input[type=radio]:nth-of-type( $i ):checked ~ .slider__arrows label:nth-of-type( $ipp ),');
107120
@{result} {
108121
display: flex;
109122
}
110123
}
111124
& {
112-
.create-selector('.slider--blue input[type=radio]:nth-of-type( $i ):checked ~ .slider__arrows label:nth-of-type( $imm ) span::after,');
125+
.create-selector('.slider input[type=radio]:nth-of-type( $i ):checked ~ .slider__arrows label:nth-of-type( $imm ) span::after,');
113126
@{result} {
114127
content: '\003c';
115128
display: block;
116129
}
117130
}
118131
& {
119-
.create-selector('.slider--blue input[type=radio]:nth-of-type( $i ):checked ~ .slider__arrows label:nth-of-type( $ipp ) span::after,');
132+
.create-selector('.slider input[type=radio]:nth-of-type( $i ):checked ~ .slider__arrows label:nth-of-type( $ipp ) span::after,');
120133
@{result} {
121134
content: '\003e';
122135
display: block;
123136
}
124137
}
138+
& {
139+
.create-selector('.slider input[type=radio]:nth-of-type( $i ):checked ~ .slider__pills label:nth-of-type( $i ),');
140+
@{result} {
141+
color: fade(#000, 80%);
142+
font-weight: 900;
143+
}
144+
}
125145
& {
126146
.create-selector('.slider--blue input[type=radio]:nth-of-type( $i ):checked ~ .slider__pills label:nth-of-type( $i ),');
127147
@{result} {

less/slider/_navigation.less

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
@import "_variables";
2+
@import "../_mixins";
3+
@import "../_themes";
4+
15
.slider {
26
label {
37
cursor: pointer;
@@ -48,13 +52,23 @@
4852
position: absolute;
4953
.same(0, top left);
5054

55+
@size: unit(@slider-border-width * 2, px);
56+
.same(calc(~"100% - @{size}"), height width);
57+
58+
margin: @slider-border-width;
59+
5160
display: flex;
5261
justify-content: space-between;
5362

5463
label {
5564
display: none;
5665
height: 100%;
5766

67+
color: #000;
68+
font-size: 2em;
69+
margin: 0;
70+
padding: @arrows-padding;
71+
5872
flex-direction: column;
5973
justify-content: center;
6074
}
@@ -65,14 +79,7 @@
6579
color: @blue-header-color;
6680
}
6781
.slider__arrows {
68-
height: calc(~"100% - @{slider-border-width}*2");
69-
width: calc(~"100% - @{slider-border-width}*2");
70-
margin: @slider-border-width;
71-
7282
label {
73-
margin: 0;
74-
padding: @arrows-padding;
75-
7683
color: @blue-header-color;
7784
font-size: 3.5em;
7885

less/slider/_variables.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@max-slides: 15;
1+
@max-slides: 10;
22

33
@slider-width: 80%;
44
@slider-height: 400px;

0 commit comments

Comments
 (0)