summaryrefslogtreecommitdiff
path: root/web-ui/app/scss/_mixins.scss
blob: 4e7b1fbb301b2ad9d630ad1ebff7cab2191f9419 (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
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
@import 'base/colors';

// SHARED MIXINS
@mixin btn-transition {
  @include transition-property(background-color);
  @include transition-duration(300ms);
  @include transition-timing-function(ease-out);
}

@mixin tooltip($top: 8px, $left: 40px) {
  background: rgba(0, 0, 0, 0.7);
  color: $white;
  position: absolute;
  z-index: 2;
  left: $left;
  top: $top;
  font-size: 0.8rem;
  padding: 2px 10px;
  white-space: nowrap;
  @include border-radius(2px);
}

@mixin tt-hint {
  .tt-hint {
    color: $medium_light_grey
  }
  .tt-dropdown-menu {
    width: 400px;
    margin-top: 6px;
    padding: 8px 0;
    background-color: $contrast;
    border: 1px solid darken($contrast, 5%);
  }
  .tt-suggestion {
    padding: 3px 10px;
    font-size: 18px;
    line-height: 24px;
    &.tt-cursor {
      background-color: $white;
    }
    p {
      margin: 0;
    }
  }
}

// FORM MIXINS
@mixin check-box {
  background-color: $white;
  border: 1px solid $light_gray;
  padding: 7px;
  margin: 3px 0;
  cursor: pointer;
  display: inline-block;
  position: relative;
  @include border-radius(2px);
  @include appearance(none);

  &:focus {
    outline: none;
    border-color: $medium_dark_grey;
  }

  &:active, &:checked:active {
  }

  &:checked {
    background-color: $contrast;
    border: 1px solid darken($lighter_gray, 10%);
    color: $dark_grey;
  }

  &:checked:after {
    content: '\2714';
    font-size: 1em;
    position: absolute;
    bottom: -2px;
    left: 1px;
    color: $navigation_background;
  }
}

@mixin tags {
  i.tags-label {
    vertical-align: bottom;
    font-size: medium;
    color: $light_gray;
  }

  ul.tags {
    margin-bottom: 0;
    li {
      font-size: 0.6rem;
      background-color: lighten($action_buttons, 12);
      color: white;
      display: inline;
      padding: 2px 3px;
      margin: 0 1px;
      position: relative;
      @include border-radius(2px);
      &[data-tag="drafts"] {
        color: $attention;
        background: $contrast;
      }
      &.tag:hover {
        text-decoration: line-through;
        cursor: pointer;
      }
      &.add-new {
        opacity: 0.6;
        transition: background-color 150ms ease-out;
        background: transparent;
        border: 1px solid $lighter_gray;
        line-height: 0;
        padding: 1px 2px;
        margin-left: -5px;
        @include border-radius(2px);
        &:hover {
          opacity: 1;
          background: $lighter_gray;
        }
        i {
          &:before {
            vertical-align: middle;
            font-size: smaller;
          }
        }
      }
      &.new-tag {
        font-size: 0.7em;
        display: inline-block;
        padding: 0;
        background: transparent;
        input {
          display: inline;
          font-size: 1em;
          padding: 1px 5px;
          width: 120px;
          margin: 0;
        }
        @include tt-hint;
        .tt-dropdown-menu {
          width: 250px;
        }
      }
    }
  }
}

@mixin searching($top, $left, $color, $size){
  &.searching {
    &:after {
      font-family: FontAwesome;
      content: "\f002";
      font-size: $size;
      top: $top;
      left: $left;
      position: absolute;
      color: $color;
      text-shadow: -1px 0 $contrast, 0 1px $contrast, 1px 0 $contrast, 0 -1px $contrast;
    }
  }
}