Project

General

Profile

1
// Name:            Breadcrumb
2
// Description:     Component to create a breadcrumb navigation
3
//
4
// Component:       `uk-breadcrumb`
5
//
6
// States:          `uk-disabled`
7
//
8
// ========================================================================
9

    
10

    
11
// Variables
12
// ========================================================================
13

    
14
@breadcrumb-item-font-size:                         @global-small-font-size;
15
@breadcrumb-item-color:                             @global-muted-color;
16
@breadcrumb-item-hover-color:                       @global-color;
17
@breadcrumb-item-hover-text-decoration:             none;
18
@breadcrumb-item-active-color:                      @global-color;
19

    
20
@breadcrumb-divider:                                "/";
21
@breadcrumb-divider-margin-horizontal:              20px;
22
@breadcrumb-divider-color:                          @global-muted-color;
23

    
24

    
25
/* ========================================================================
26
   Component: Breadcrumb
27
 ========================================================================== */
28

    
29
/*
30
 * 1. Allow items to wrap into the next line
31
 * 2. Reset lists
32
 */
33

    
34
.uk-breadcrumb {
35
    display: -ms-flexbox;
36
    display: -webkit-flex;
37
    display: flex;
38
    /* 1 */
39
    -ms-flex-wrap: wrap;
40
    -webkit-flex-wrap: wrap;
41
    flex-wrap: wrap;
42
    /* 2 */
43
    padding: 0;
44
    list-style: none;
45
    .hook-breadcrumb;
46
}
47

    
48
/*
49
 * Space is allocated solely based on content dimensions: 0 0 auto
50
 */
51

    
52
.uk-breadcrumb > * {
53
    -ms-flex: none;
54
    -webkit-flex: none;
55
    flex: none;
56
}
57

    
58

    
59
/* Items
60
 ========================================================================== */
61

    
62
.uk-breadcrumb > * > * {
63
    display: inline-block;
64
    font-size: @breadcrumb-item-font-size;
65
    color: @breadcrumb-item-color;
66
    .hook-breadcrumb-item;
67
}
68

    
69
/* Hover + Focus */
70
.uk-breadcrumb > * > :hover,
71
.uk-breadcrumb > * > :focus {
72
    color: @breadcrumb-item-hover-color;
73
    text-decoration: @breadcrumb-item-hover-text-decoration;
74
    .hook-breadcrumb-item-hover;
75
}
76

    
77
/* Active */
78
.uk-breadcrumb > :last-child > * {
79
    color: @breadcrumb-item-active-color;
80
    .hook-breadcrumb-item-active;
81
}
82

    
83
/*
84
 * Divider
85
 * `nth-child` makes it also work without JS if it's only one row
86
 */
87

    
88
.uk-breadcrumb > :nth-child(n+2):not(.uk-first-column)::before {
89
    content: @breadcrumb-divider;
90
    display: inline-block;
91
    margin: 0 @breadcrumb-divider-margin-horizontal;
92
    color: @breadcrumb-divider-color;
93
    .hook-breadcrumb-divider;
94
}
95

    
96

    
97
// Hooks
98
// ========================================================================
99

    
100
.hook-breadcrumb-misc;
101

    
102
.hook-breadcrumb() {}
103
.hook-breadcrumb-item() {}
104
.hook-breadcrumb-item-hover() {}
105
.hook-breadcrumb-item-active() {}
106
.hook-breadcrumb-divider() {}
107
.hook-breadcrumb-misc() {}
108

    
109

    
110
// Inverse
111
// ========================================================================
112

    
113
@inverse-breadcrumb-item-color:                @inverse-global-muted-color;
114
@inverse-breadcrumb-item-hover-color:          @inverse-global-color;
115
@inverse-breadcrumb-item-active-color:         @inverse-global-color;
116
@inverse-breadcrumb-divider-color:             @inverse-global-muted-color;
117

    
118
.hook-inverse() {
119

    
120
    .uk-breadcrumb > * > * {
121
        color: @inverse-breadcrumb-item-color;
122
        .hook-inverse-breadcrumb-item;
123
    }
124

    
125
    .uk-breadcrumb > * > :hover,
126
    .uk-breadcrumb > * > :focus {
127
        color: @inverse-breadcrumb-item-hover-color;
128
        .hook-inverse-breadcrumb-item-hover;
129
    }
130

    
131
    .uk-breadcrumb > :last-child > * {
132
        color: @inverse-breadcrumb-item-active-color;
133
        .hook-inverse-breadcrumb-item-active;
134
    }
135

    
136
    //
137
    // Divider
138
    //
139

    
140
    .uk-breadcrumb > :nth-child(n+2):not(.uk-first-column)::before {
141
        color: @inverse-breadcrumb-divider-color;
142
        .hook-inverse-breadcrumb-divider;
143
    }
144

    
145
}
146

    
147
.hook-inverse-breadcrumb-item() {}
148
.hook-inverse-breadcrumb-item-hover() {}
149
.hook-inverse-breadcrumb-item-active() {}
150
.hook-inverse-breadcrumb-divider() {}
(11-11/66)