summaryrefslogtreecommitdiff
path: root/app/assets/stylesheets/base/mixins.scss
blob: 05f5bd79f91e96613f69188d9df8bf7a7961775b (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
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
192
193
194
195
196
197
/**
 * Generic mixins
 */
 @mixin box-shadow($shadow) {
  -webkit-box-shadow: $shadow;
  -moz-box-shadow: $shadow;
  -ms-box-shadow: $shadow;
  -o-box-shadow: $shadow;
  box-shadow: $shadow;
}

@mixin border-radius($radius) {
  -webkit-border-radius: $radius;
  -moz-border-radius: $radius;
  -ms-border-radius: $radius;
  -o-border-radius: $radius;
  border-radius: $radius;
}

@mixin border-radius-left($radius) {
  @include border-radius($radius 0 0 $radius)
}

@mixin border-radius-right($radius) {
  @include border-radius(0 0 $radius $radius)
}

@mixin linear-gradient($from, $to) {
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from($from), to($to));
  background-image: -webkit-linear-gradient($from, $to);
  background-image: -moz-linear-gradient($from, $to);
  background-image: -ms-linear-gradient($from, $to);
  background-image: -o-linear-gradient($from, $to);
}

@mixin transition($transition) {
  -webkit-transition: $transition;
  -moz-transition: $transition;
  -ms-transition: $transition;
  -o-transition: $transition;
  transition: $transition;
}

/**
 * Prefilled mixins
 * Mixins with fixed values
 */

@mixin shade {
  @include box-shadow(0 0 3px #ddd);
}

@mixin solid-shade {
  @include box-shadow(0 0 0 3px #f1f1f1);
}

@mixin md-typography {
  font-size: 15px;
  line-height: 1.5;

  img {
    max-width: 100%;
  }

  *:first-child {
    margin-top: 0;
  }

  code {
    font-family: $monospace_font;
    white-space: pre;
    word-wrap: normal;
    padding: 1px 2px;
  }

  kbd {
    display: inline-block;
    padding: 3px 5px;
    font-size: 11px;
    line-height: 10px;
    color: #555;
    vertical-align: middle;
    background-color: #FCFCFC;
    border-width: 1px;
    border-style: solid;
    border-color: #CCC #CCC #BBB;
    border-image: none;
    border-radius: 3px;
    box-shadow: 0px -1px 0px #BBB inset;
  }

  h1 {
    margin-top: 45px;
    font-size: 2.5em;
  }

  h2 {
    margin-top: 40px;
    font-size: 2em;
  }

  h3 {
    margin-top: 35px;
    font-size: 1.5em;
  }

  h4 {
    margin-top: 30px;
    font-size: 1.2em;
  }

  blockquote {
    color: #888;
    font-size: 15px;
    line-height: 1.5;
  }

  table {
    @extend .table;
    @extend .table-bordered;
    th {
      background: #EEE;
    }
  }

  p > code {
    font-size: inherit;
    font-weight: inherit;
  }

  li {
    line-height: 1.5;
  }

  a[href*="/uploads/"], a[href*="storage.googleapis.com/google-code-attachments/"] {
    &:before {
      margin-right: 4px;

      font: normal normal normal 14px/1 FontAwesome;
      font-size: inherit;
      text-rendering: auto;
      -webkit-font-smoothing: antialiased;
      content: "\f0c6";
    }

    &:hover:before {
      text-decoration: none;
    }
  }
}

@mixin str-truncated($max_width: 82%) {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
  white-space: nowrap;
  max-width: $max_width;
}

/*
 * Base mixin for lists in GitLab
 */
@mixin basic-list {
  margin: 5px 0px;
  padding: 0px;
  list-style: none;

  li {
    padding: 10px 0;
    border-bottom: 1px solid #EEE;
    overflow: hidden;
    display: block;
    margin: 0px;

    &:last-child {
      border:none
    }

    &.active {
      background: #f9f9f9;
      a {
        font-weight: bold;
      }
    }

    &.hide {
      display: none;
    }

    &.light {
      a {
        color: #777;
      }
    }
  }
}