File tree Expand file tree Collapse file tree 6 files changed +120
-56
lines changed Expand file tree Collapse file tree 6 files changed +120
-56
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 @@ -38,10 +38,43 @@ import { Pagination as CarouselPagination } from 'vue3-carousel'
38
38
| ` --vc-pgn-active-color ` | ` var(--vc-clr-primary) ` | Active pagination button color |
39
39
| ` --vc-pgn-background-color ` | ` var(--vc-clr-secondary) ` | Pagination button background color |
40
40
| ` --vc-pgn-border-radius ` | ` 0 ` | Pagination button border radius |
41
+ | ` --vc-pgn-gap ` | ` 6px ` | Gap between pagination buttons |
41
42
| ` --vc-pgn-height ` | ` 4px ` | Pagination button height |
42
- | ` --vc-pgn-margin ` | ` 6px 5px ` | Pagination button margin |
43
+ | ` --vc-png-bottom ` | ` 10px ` | Bottom spacing for pagination |
44
+ | ` --vc-png-left ` | ` auto ` | Left spacing for vertical mode |
45
+ | ` --vc-png-right ` | ` 10px ` | Right spacing for vertical mode |
43
46
| ` --vc-pgn-width ` | ` 16px ` | Pagination button width |
44
47
48
+ ### Customization Examples
49
+
50
+ There are two ways to customize the pagination appearance:
51
+
52
+ #### 1. Using CSS Custom Properties
53
+
54
+ ``` css
55
+ .carousel {
56
+ --vc-pgn-background-color : white ;
57
+ --vc-pgn-active-color : red ;
58
+ --vc-pgn-border-radius : 5px ;
59
+ --vc-pgn-height : 5px ;
60
+ --vc-pgn-width : 5px ;
61
+ }
62
+ ```
63
+
64
+ #### 2. Direct CSS Override
65
+
66
+ ``` css
67
+ .carousel__pagination-button {
68
+ height : 5px ;
69
+ width : 5px ;
70
+ border-radius : 5px ;
71
+ background-color : white ;
72
+ }
73
+ .carousel__pagination-button--active {
74
+ background-color : red ;
75
+ }
76
+ ```
77
+
45
78
## Accessibility
46
79
47
80
- Pagination buttons are properly labeled for screen readers
Original file line number Diff line number Diff line change 20
20
gap : var (--vc-slide-gap );
21
21
height : 100% ;
22
22
list-style : none;
23
- margin : 0 !important ;
24
- padding : 0 !important ;
23
+ margin : 0 ;
24
+ padding : 0 ;
25
25
position : relative;
26
26
transition : transform ease-out;
27
27
transition-duration : var (--vc-transition-duration );
45
45
width : 1px ;
46
46
}
47
47
48
+ .carousel .is-rtl {
49
+ direction : rtl;
50
+ }
51
+
48
52
.carousel .is-ttb .carousel__track {
49
53
flex-direction : column;
50
54
}
70
74
71
75
.carousel .is-effect-fade .carousel__slide {
72
76
grid-area : 1 / 1 ;
73
- height : 100% !important ;
77
+ height : 100% ;
74
78
opacity : 0 ;
75
79
pointer-events : none;
76
80
transition : opacity ease-in-out;
77
81
transition-duration : var (--vc-transition-duration );
78
- width : 100% !important ;
82
+ width : 100% ;
79
83
}
80
84
81
85
.carousel .is-effect-fade .carousel__slide--active {
Original file line number Diff line number Diff line change 1
1
: root {
2
- --vc-icn-width : 1.2 em ;
2
+ --vc-icn-width : 100 % ;
3
3
}
4
4
5
5
.carousel__icon {
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
Original file line number Diff line number Diff line change 2
2
--vc-pgn-active-color : var (--vc-clr-primary );
3
3
--vc-pgn-background-color : var (--vc-clr-secondary );
4
4
--vc-pgn-border-radius : 0 ;
5
+ --vc-pgn-gap : 6px ;
5
6
--vc-pgn-height : 4px ;
6
- --vc-pgn-margin : 6px 5px ;
7
+ --vc-png-bottom : 10px ;
8
+ --vc-png-left : auto;
9
+ --vc-png-right : 10px ;
7
10
--vc-pgn-width : 16px ;
8
11
}
9
12
10
13
.carousel__pagination {
11
- bottom : 5 px ;
14
+ bottom : var ( --vc-png-bottom ) ;
12
15
display : flex;
16
+ gap : var (--vc-pgn-gap );
13
17
justify-content : center;
14
18
left : 50% ;
15
- line-height : 0 ;
16
- list-style : none !important ;
17
- margin : 0 !important ;
18
- padding : 0 !important ;
19
+ list-style : none;
20
+ margin : 0 ;
21
+ padding : 0 ;
19
22
position : absolute;
20
23
transform : translateX (-50% );
21
24
}
22
25
23
26
.carousel__pagination-button {
24
- border : 0 ;
25
- cursor : pointer;
26
- margin : var (--vc-pgn-margin );
27
27
background-color : var (--vc-pgn-background-color );
28
+ border : 0 ;
28
29
border-radius : var (--vc-pgn-border-radius );
30
+ cursor : pointer;
29
31
display : block;
30
32
height : var (--vc-pgn-height );
31
- width : var ( --vc-pgn-width ) ;
33
+ margin : 0 ;
32
34
padding : 0 ;
35
+ width : var (--vc-pgn-width );
33
36
}
34
37
35
38
.carousel__pagination-button--active {
46
49
.carousel__pagination {
47
50
bottom : 50% ;
48
51
flex-direction : column;
49
- left : auto ;
50
- right : 5 px ;
52
+ left : var ( --vc-png-left ) ;
53
+ right : var ( --vc-png-right ) ;
51
54
transform : translateY (50% );
52
55
}
53
56
You can’t perform that action at this time.
0 commit comments