-
Notifications
You must be signed in to change notification settings - Fork 11
/
_tabs.scss
165 lines (132 loc) · 3.41 KB
/
_tabs.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
// Foundation for Sites by ZURB
// foundation.zurb.com
// Licensed under MIT Open Source
////
/// @group tabs
////
/// Default margin of the tab bar.
/// @type Number
$tab-margin: 0 !default;
/// Default background color of a tab bar.
/// @type Color
$tab-background: $white !default;
/// active background color of a tab bar.
/// @type Color
$tab-background-active: $light-gray !default;
/// Font size of tab items.
/// @type Number
$tab-item-font-size: rem-calc(12) !default;
/// Default background color on hover for items in a Menu.
$tab-item-background-hover: $white !default;
/// Default padding of a tab item.
/// @type Number
$tab-item-padding: 1.25rem 1.5rem !default;
/// Maximum number of `expand-n` classes to include in the CSS.
/// @type Number
$tab-expand-max: 6 !default;
/// Default background color of tab content.
/// @type Color
$tab-content-background: $white !default;
/// Default border color of tab content.
/// @type Color
$tab-content-border: $light-gray !default;
/// Default text color of tab content.
/// @type Color
$tab-content-color: foreground($tab-background, $primary-color) !default;
/// Default padding for tab content.
/// @type Number | List
$tab-content-padding: 1rem !default;
/// Adds styles for a tab container. Apply this to a `<ul>`.
@mixin tabs-container {
@include clearfix;
margin: $tab-margin;
list-style-type: none;
background: $tab-background;
border: 1px solid $tab-content-border;
}
/// Augments a tab container to have vertical tabs. Use this in conjunction with `tabs-container()`.
@mixin tabs-container-vertical {
> li {
width: auto;
float: none;
display: block;
}
}
/// Adds styles for the links within a tab container. Apply this to the `<li>` elements inside a tab container.
@mixin tabs-title {
float: #{$global-left};
> a {
display: block;
padding: $tab-item-padding;
line-height: 1;
font-size: $tab-item-font-size;
&:hover {
background: $tab-item-background-hover;
}
&:focus,
&[aria-selected='true'] {
background: $tab-background-active;
}
}
}
/// Adds styles for the wrapper that surrounds a tab group's content panes.
@mixin tabs-content {
background: $tab-content-background;
transition: all 0.5s ease;
border: 1px solid $tab-content-border;
border-top: 0;
}
/// Augments a tab content container to have a vertical style, by shifting the border around. Use this in conjunction with `tabs-content()`.
@mixin tabs-content-vertical {
border: 1px solid $tab-content-border;
border-#{$global-left}: 0;
}
/// Adds styles for an individual tab content panel within the tab content container.
@mixin tabs-panel {
display: none;
padding: $tab-content-padding;
&.is-active {
display: block;
}
}
@mixin foundation-tabs {
.tabs {
@include tabs-container;
}
// Vertical
.tabs.vertical {
@include tabs-container-vertical;
}
// Simple
.tabs.simple {
> li > a {
padding: 0;
&:hover {
background: transparent;
}
}
}
// Primary color
.tabs.primary {
background: $primary-color;
> li > a {
color: foreground($primary-color);
&:hover,
&:focus {
background: smart-scale($primary-color);
}
}
}
.tabs-title {
@include tabs-title;
}
.tabs-content {
@include tabs-content;
}
.tabs-content.vertical {
@include tabs-content-vertical;
}
.tabs-panel {
@include tabs-panel;
}
}