aboutsummaryrefslogtreecommitdiffstats
path: root/scss/uikit/components/tab.scss
blob: 87e0a678d861a86fb5216d4c959b2822e9665439 (plain) (blame)
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
// Name:            Tab
// Description:     Component to create a tabbed navigation
//
// Component:       `uk-tab`
//
// Modifiers:       `uk-tab-bottom`
//                  `uk-tab-left`
//                  `uk-tab-right`
//
// States:          `uk-active`
//                  `uk-disabled`
//
// ========================================================================


// Variables
// ========================================================================

$tab-margin-horizontal:                   20px !default;

$tab-item-padding-horizontal:             10px !default;
$tab-item-padding-vertical:               5px !default;
$tab-item-color:                          $global-muted-color !default;
$tab-item-hover-color:                    $global-color !default;
$tab-item-hover-text-decoration:          none !default;
$tab-item-active-color:                   $global-emphasis-color !default;
$tab-item-disabled-color:                 $global-muted-color !default;


/* ========================================================================
   Component: Tab
 ========================================================================== */

/*
 * 1. Allow items to wrap into the next line
 * 2. Gutter
 * 3. Reset list
 */

.uk-tab {
    display: flex;
    /* 1 */
    flex-wrap: wrap;
    /* 2 */
    margin-left: (-$tab-margin-horizontal);
    /* 3 */
    padding: 0;
    list-style: none;
    @if(mixin-exists(hook-tab)) {@include hook-tab();}
}

/*
 * 1. Space is allocated solely based on content dimensions: 0 0 auto
 * 2. Gutter
 * 3. Create position context for dropdowns
 */

.uk-tab > * {
    /* 1 */
    flex: none;
    /* 2 */
    padding-left: $tab-margin-horizontal;
    /* 3 */
    position: relative;
}


/* Items
 ========================================================================== */

/*
 * Items must target `a` elements to exclude other elements (e.g. dropdowns)
 * 1. Center text if a width is set
 * 2. Style
 */

.uk-tab > * > a {
    /* 1 */
    display: block;
    text-align: center;
    /* 2 */
    padding: $tab-item-padding-vertical $tab-item-padding-horizontal;
    color: $tab-item-color;
    @if(mixin-exists(hook-tab-item)) {@include hook-tab-item();}
}

/* Hover + Focus */
.uk-tab > * > a:hover,
.uk-tab > * > a:focus {
    color: $tab-item-hover-color;
    text-decoration: $tab-item-hover-text-decoration;
    @if(mixin-exists(hook-tab-item-hover)) {@include hook-tab-item-hover();}
}

/* Active */
.uk-tab > .uk-active > a {
    color: $tab-item-active-color;
    @if(mixin-exists(hook-tab-item-active)) {@include hook-tab-item-active();}
}

/* Disabled */
.uk-tab > .uk-disabled > a {
    color: $tab-item-disabled-color;
    @if(mixin-exists(hook-tab-item-disabled)) {@include hook-tab-item-disabled();}
}


/* Position modifier
 ========================================================================== */

/*
 * Bottom
 */

.uk-tab-bottom {
    @if(mixin-exists(hook-tab-bottom)) {@include hook-tab-bottom();}
}

.uk-tab-bottom > * > a {
    @if(mixin-exists(hook-tab-bottom-item)) {@include hook-tab-bottom-item();}
}

/*
 * Left + Right
 * 1. Reset Gutter
 */

.uk-tab-left,
.uk-tab-right {
    flex-direction: column;
    /* 1 */
    margin-left: 0;
}

/* 1 */
.uk-tab-left > *,
.uk-tab-right > * { padding-left: 0; }

.uk-tab-left {
    @if(mixin-exists(hook-tab-left)) {@include hook-tab-left();}
}

.uk-tab-right {
    @if(mixin-exists(hook-tab-right)) {@include hook-tab-right();}
}

.uk-tab-left > * > a {
    text-align: left;
    @if(mixin-exists(hook-tab-left-item)) {@include hook-tab-left-item();}
}

.uk-tab-right > * > a {
    text-align: left;
    @if(mixin-exists(hook-tab-right-item)) {@include hook-tab-right-item();}
}


// Hooks
// ========================================================================

@if(mixin-exists(hook-tab-misc)) {@include hook-tab-misc();}

// @mixin hook-tab(){}
// @mixin hook-tab-item(){}
// @mixin hook-tab-item-hover(){}
// @mixin hook-tab-item-active(){}
// @mixin hook-tab-item-disabled(){}
// @mixin hook-tab-bottom(){}
// @mixin hook-tab-bottom-item(){}
// @mixin hook-tab-left(){}
// @mixin hook-tab-left-item(){}
// @mixin hook-tab-right(){}
// @mixin hook-tab-right-item(){}
// @mixin hook-tab-misc(){}


// Inverse
// ========================================================================

$inverse-tab-item-color:                        $inverse-global-muted-color !default;
$inverse-tab-item-hover-color:                  $inverse-global-color !default;
$inverse-tab-item-active-color:                 $inverse-global-emphasis-color !default;
$inverse-tab-item-disabled-color:               $inverse-global-muted-color !default;



// @mixin hook-inverse-tab(){}
// @mixin hook-inverse-tab-item(){}
// @mixin hook-inverse-tab-item-hover(){}
// @mixin hook-inverse-tab-item-active(){}
// @mixin hook-inverse-tab-item-disabled(){}