1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | $tab-margin: 0 !default;
|
12 |
|
13 |
|
14 |
|
15 | $tab-background: $white !default;
|
16 |
|
17 |
|
18 |
|
19 | $tab-color: $primary-color !default;
|
20 |
|
21 |
|
22 |
|
23 | $tab-background-active: $light-gray !default;
|
24 |
|
25 |
|
26 |
|
27 | $tab-active-color: $primary-color !default;
|
28 |
|
29 |
|
30 |
|
31 | $tab-item-font-size: rem-calc(12) !default;
|
32 |
|
33 |
|
34 | $tab-item-background-hover: $white !default;
|
35 |
|
36 |
|
37 |
|
38 | $tab-item-padding: 1.25rem 1.5rem !default;
|
39 |
|
40 |
|
41 |
|
42 | $tab-expand-max: 6 !default;
|
43 |
|
44 |
|
45 |
|
46 | $tab-content-background: $white !default;
|
47 |
|
48 |
|
49 |
|
50 | $tab-content-border: $light-gray !default;
|
51 |
|
52 |
|
53 |
|
54 | $tab-content-color: $body-font-color !default;
|
55 |
|
56 |
|
57 |
|
58 | $tab-content-padding: 1rem !default;
|
59 |
|
60 |
|
61 | @mixin tabs-container (
|
62 | $margin: $tab-margin,
|
63 | $background: $tab-background,
|
64 | $border-color: $tab-content-border
|
65 | ) {
|
66 | @include clearfix;
|
67 | margin: $margin;
|
68 | border: 1px solid $border-color;
|
69 | background: $background;
|
70 | list-style-type: none;
|
71 | }
|
72 |
|
73 |
|
74 | @mixin tabs-container-vertical {
|
75 | > li {
|
76 | display: block;
|
77 | float: none;
|
78 | width: auto;
|
79 | }
|
80 | }
|
81 |
|
82 |
|
83 | @mixin tabs-title (
|
84 | $padding: $tab-item-padding,
|
85 | $font-size: $tab-item-font-size,
|
86 | $color: $tab-color,
|
87 | $color-active: $tab-active-color,
|
88 | $background-hover: $tab-item-background-hover,
|
89 | $background-active: $tab-background-active
|
90 | ) {
|
91 | float: #{$global-left};
|
92 |
|
93 | > a {
|
94 | display: block;
|
95 | padding: $padding;
|
96 | font-size: $font-size;
|
97 | line-height: 1;
|
98 | color: $color;
|
99 |
|
100 | &:hover {
|
101 | background: $background-hover;
|
102 | color: scale-color($color, $lightness: -14%);
|
103 | }
|
104 |
|
105 | &:focus,
|
106 | &[aria-selected='true'] {
|
107 | background: $background-active;
|
108 | color: $color-active;
|
109 | }
|
110 | }
|
111 | }
|
112 |
|
113 |
|
114 | @mixin tabs-content (
|
115 | $background: $tab-content-background,
|
116 | $color: $tab-content-color,
|
117 | $border-color: $tab-content-border
|
118 | ) {
|
119 | border: 1px solid $border-color;
|
120 | border-top: 0;
|
121 | background: $background;
|
122 | color: $color;
|
123 | transition: all 0.5s ease;
|
124 | }
|
125 |
|
126 |
|
127 | @mixin tabs-content-vertical (
|
128 | $border-color: $tab-content-border
|
129 | ) {
|
130 | border: 1px solid $border-color;
|
131 | border-#{$global-left}: 0;
|
132 | }
|
133 |
|
134 |
|
135 | @mixin tabs-panel (
|
136 | $padding: $tab-content-padding
|
137 | ) {
|
138 | display: none;
|
139 | padding: $padding;
|
140 |
|
141 | &.is-active {
|
142 | display: block;
|
143 | }
|
144 | }
|
145 |
|
146 | @mixin foundation-tabs {
|
147 | .tabs {
|
148 | @include tabs-container;
|
149 | }
|
150 |
|
151 |
|
152 | .tabs.vertical {
|
153 | @include tabs-container-vertical;
|
154 | }
|
155 |
|
156 |
|
157 | .tabs.simple {
|
158 | > li > a {
|
159 | padding: 0;
|
160 |
|
161 | &:hover {
|
162 | background: transparent;
|
163 | }
|
164 | }
|
165 | }
|
166 |
|
167 |
|
168 | .tabs.primary {
|
169 | background: $primary-color;
|
170 |
|
171 | > li > a {
|
172 | color: color-pick-contrast($primary-color);
|
173 |
|
174 | &:hover,
|
175 | &:focus {
|
176 | background: smart-scale($primary-color);
|
177 | }
|
178 | }
|
179 | }
|
180 |
|
181 | .tabs-title {
|
182 | @include tabs-title;
|
183 | }
|
184 |
|
185 | .tabs-content {
|
186 | @include tabs-content;
|
187 | }
|
188 |
|
189 | .tabs-content.vertical {
|
190 | @include tabs-content-vertical;
|
191 | }
|
192 |
|
193 | .tabs-panel {
|
194 | @include tabs-panel;
|
195 | }
|
196 | }
|