Project

General

Profile

1
// Name:            Badge
2
// Description:     Component to create notification badges
3

    
4
// Component:       `uk-badge`
5
//
6
// ========================================================================
7

    
8

    
9
// Variables
10
// ========================================================================
11

    
12
$badge-size:                                     22px !default;
13
$badge-padding-vertical:                         0 !default;
14
$badge-padding-horizontal:                       5px !default;
15
$badge-border-radius:                            500px !default;
16
$badge-background:                               $global-primary-background !default;
17
$badge-color:                                    $global-inverse-color !default;
18
$badge-font-size:                                $global-small-font-size !default;
19

    
20
$badge-hover-color:                              $global-inverse-color !default;
21

    
22

    
23
/* ========================================================================
24
   Component: Badge
25
 ========================================================================== */
26

    
27
/*
28
 * 1. Style
29
 * 2. Center child vertically and horizontally
30
 */
31

    
32
.uk-badge {
33
    box-sizing: border-box;
34
    min-width: $badge-size;
35
    height: $badge-size;
36
    line-height: $badge-size;
37
    padding: $badge-padding-vertical $badge-padding-horizontal;
38
    border-radius: $badge-border-radius;
39
    vertical-align: middle;
40
    /* 1 */
41
    background: $badge-background;
42
    color: $badge-color;
43
    font-size: $badge-font-size;
44
    /* 2 */
45
    display: -ms-inline-flexbox;
46
    display: -webkit-inline-flex;
47
    display: inline-flex;
48
    -ms-flex-pack: center;
49
    -webkit-justify-content: center;
50
    justify-content: center;
51
    -ms-flex-align: center;
52
    -webkit-align-items: center;
53
    align-items: center;
54
    @if(mixin-exists(hook-badge)) {@include hook-badge();}
55
}
56

    
57
/*
58
 * Required for `a`
59
 */
60

    
61
.uk-badge:hover,
62
.uk-badge:focus {
63
    color: $badge-hover-color;
64
    text-decoration: none;
65
    outline: none;
66
    @if(mixin-exists(hook-badge-hover)) {@include hook-badge-hover();}
67
}
68

    
69

    
70
// Hooks
71
// ========================================================================
72

    
73
@if(mixin-exists(hook-badge-misc)) {@include hook-badge-misc();}
74

    
75
// @mixin hook-badge(){}
76
// @mixin hook-badge-hover(){}
77
// @mixin hook-badge-misc(){}
78

    
79

    
80
// Inverse
81
// ========================================================================
82

    
83
$inverse-badge-background:                      $inverse-global-primary-background !default;
84
$inverse-badge-color:                           $inverse-global-inverse-color !default;
85
$inverse-badge-hover-color:                     $inverse-global-inverse-color !default;
86

    
87

    
88

    
89
// @mixin hook-inverse-badge(){}
90
// @mixin hook-inverse-badge-hover(){}
(9-9/66)