summaryrefslogtreecommitdiff
path: root/web-ui/app/scss/mixins/_tags.scss
blob: 9bb287ea3b5ca6981753a8aca56cf083e5f3e96a (plain)
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
$tags-font-size: 0.6rem;

@mixin tags {
    & > * {
        display: inline;
    }

    &-tag {
        font-size: $tags-font-size;
        font-weight: 700;
        background-color: $dark_blue;
        color: white;
        padding: 2px 4px;
        margin: 0 1px;
        border-radius: 2px;
    }
}

@mixin tags-editable {
    @include tags;

    &-tag:hover {
        text-decoration: line-through;
        cursor: pointer;
        position: relative;

        &:before {
            @include tooltip(130%, 25%);

            content: "click to remove";
            text-transform: lowercase;
        }
    }

    &-label {
        vertical-align: bottom;
        color: $light_gray;
    }

    &-new-button {
        font-size: $tags-font-size;
        padding: 0;
        background: transparent;
        border-radius: 2px;
        padding: 2px;

        &:hover {
            opacity: 1;
            background: $lighter_gray;
        }
    }

    &-name-input {
        opacity: 0.6;
        transition: background-color 150ms ease-out;

        &:hover {
            opacity: 1;
        }

        // twitter typeahead classes. those are set via JS, with relatively high specificity,
        // hence box-model-related properties are repeated
        // https://github.com/twitter/typeahead.js/blob/master/doc/jquery_typeahead.md#class-names

        $suggestion-border: 1px solid darken($contrast, 5%);
        $input-field-padding: 1px 5px;
        $input-field-margin: 2px;

        & * .tt-input {
            border-radius: $input-field-margin;
            padding: $input-field-padding;
            margin-top: 2px;
            font-size: $tags-font-size;
        }

        & * .tt-hint {
            color: $medium_light_grey;
            padding: $input-field-padding;
            margin-top: $input-field-margin;
            font-size: $tags-font-size;
            background: transparent;
        }

        & * .tt-dropdown-menu {
            min-width: 250px;
            padding: 0;
            font-size: $tags-font-size;
            background-color: $contrast;
            border: $suggestion-border;
        }

        & * .tt-suggestion {
            padding: 5px 10px;
            font-size: $tags-font-size;
            border-bottom: $suggestion-border;

            &:last-child {
                border-bottom: none;
            }

            p {
                margin: 0;
            }
        }

        & * .tt-cursor {
            background-color: $white;
        }
    }
}