File tree Expand file tree Collapse file tree 2 files changed +62
-38
lines changed
src/components/Navigation Expand file tree Collapse file tree 2 files changed +62
-38
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,46 @@ You can customize the navigation buttons using slots:
68
68
| ` --vc-nav-height ` | ` 30px ` | Navigation button height |
69
69
| ` --vc-nav-width ` | ` 30px ` | Navigation button width |
70
70
71
+ ### Customization Examples
72
+
73
+ There are two ways to customize the navigation appearance:
74
+
75
+ #### 1. Using CSS Custom Properties
76
+
77
+ ``` css
78
+ .carousel {
79
+ --vc-nav-background : rgba (0 , 0 , 0 , 0.3 );
80
+ --vc-nav-color : white ;
81
+ --vc-nav-color-hover : #e5e5e5 ;
82
+ --vc-nav-border-radius : 50% ;
83
+ --vc-nav-width : 40px ;
84
+ --vc-nav-height : 40px ;
85
+ }
86
+ ```
87
+
88
+ #### 2. Direct CSS Override
89
+
90
+ ``` css
91
+ .carousel__next ,
92
+ .carousel__prev {
93
+ background : rgba (0 , 0 , 0 , 0.3 );
94
+ border-radius : 50% ;
95
+ width : 40px ;
96
+ height : 40px ;
97
+ color : white ;
98
+ }
99
+
100
+ .carousel__next :hover ,
101
+ .carousel__prev :hover {
102
+ color : #e5e5e5 ;
103
+ }
104
+
105
+ .carousel__next--disabled ,
106
+ .carousel__prev--disabled {
107
+ opacity : 0.3 ;
108
+ }
109
+ ```
110
+
71
111
## Accessibility
72
112
73
113
- Buttons include descriptive ARIA labels
Original file line number Diff line number Diff line change 13
13
background : var (--vc-nav-background );
14
14
border : 0 ;
15
15
border-radius : var (--vc-nav-border-radius );
16
- box-sizing : content-box;
17
16
color : var (--vc-nav-color );
18
17
cursor : pointer;
19
18
display : flex;
20
19
font-size : var (--vc-nav-height );
21
20
height : var (--vc-nav-height );
22
21
justify-content : center;
23
- margin : 0 10px ;
24
22
padding : 0 ;
25
23
position : absolute;
26
- text-align : center;
27
- top : 50% ;
24
+ inset-block-start : 50% ;
28
25
transform : translateY (-50% );
29
26
width : var (--vc-nav-width );
30
27
}
36
33
}
37
34
38
35
.carousel__next {
39
- right : 0 ;
36
+ inset-inline-end : 0 ;
40
37
}
41
38
42
39
.carousel__prev {
43
- left : 0 ;
40
+ inset-inline-start : 0 ;
44
41
}
45
42
46
- .carousel .is-btt {
47
- .carousel__next {
48
- top : 0 ;
49
- }
43
+ .carousel .is-vertical {
44
+ .carousel__next ,
50
45
.carousel__prev {
51
- bottom : 0 ;
46
+ inset-inline : auto 50% ;
47
+ inset-block-start : auto;
48
+ transform : translateX (50% );
52
49
}
53
- }
54
50
55
- .carousel .is-rtl {
56
- .carousel__next {
57
- left : 0 ;
58
- right : auto;
51
+ & .is-ttb {
52
+ .carousel__next {
53
+ inset-block-end : 0 ;
54
+ }
55
+ .carousel__prev {
56
+ inset-block-start : 0 ;
57
+ }
59
58
}
60
- .carousel__prev {
61
- left : auto;
62
- right : 0 ;
63
- }
64
- }
65
59
66
- .carousel .is-ttb {
67
- .carousel__next {
68
- bottom : 0 ;
69
- }
70
- .carousel__prev {
71
- top : 0 ;
72
- }
73
- }
74
-
75
- .carousel .is-vertical {
76
- .carousel__next ,
77
- .carousel__prev {
78
- left : auto;
79
- margin : 5px auto;
80
- right : 50% ;
81
- top : auto;
82
- transform : translate (50% );
60
+ & .is-btt {
61
+ .carousel__next {
62
+ inset-block-start : 0 ;
63
+ }
64
+ .carousel__prev {
65
+ inset-block-end : 0 ;
66
+ }
83
67
}
84
68
}
85
69
You can’t perform that action at this time.
0 commit comments