mixins.scss 2.08 KB
Newer Older
1 2 3
/**
 * Generic mixins
 */
connorshea's avatar
connorshea committed
4
@mixin box-shadow($shadow) {
Koen Punt's avatar
Koen Punt committed
5
  box-shadow: $shadow;
6 7
}

8 9 10 11
@mixin border-radius($radius) {
  border-radius: $radius;
}

12 13 14 15
@mixin border-radius-left($radius) {
  @include border-radius($radius 0 0 $radius)
}

16 17 18 19
@mixin border-radius-right($radius) {
  @include border-radius(0 0 $radius $radius)
}

Koen Punt's avatar
Koen Punt committed
20 21 22 23
@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);
24
  background-image: -ms-linear-gradient($from, $to);
Koen Punt's avatar
Koen Punt committed
25 26 27
  background-image: -o-linear-gradient($from, $to);
}

28 29 30 31 32 33 34 35
@mixin transition($transition) {
  -webkit-transition: $transition;
  -moz-transition: $transition;
  -ms-transition: $transition;
  -o-transition: $transition;
  transition: $transition;
}

36 37 38 39 40 41 42 43 44 45 46
/**
 * 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);
47 48
}

49
@mixin str-truncated($max_width: 82%) {
50 51 52 53 54 55 56
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
  white-space: nowrap;
  max-width: $max_width;
}
57 58 59 60 61

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

66
  > li {
67 68
    @include clearfix;

69
    padding: 10px 0;
70
    border-bottom: 1px solid #eee;
71
    display: block;
72
    margin: 0;
73 74

    &:last-child {
75
      border-bottom: none;
76 77 78 79 80
    }

    &.active {
      background: #f9f9f9;
      a {
Andrey's avatar
Andrey committed
81
        font-weight: 600;
82 83 84 85 86 87 88 89 90
      }
    }

    &.hide {
      display: none;
    }

    &.light {
      a {
91
        color: $gl-gray;
92 93 94 95
      }
    }
  }
}
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112

@mixin input-big {
  height: 36px;
  padding: 5px 10px;
  font-size: 16px;
  line-height: 24px;
  color: #7f8fa4;
  background-color: #fff;
  border-color: #e7e9ed;
}

@mixin btn-big {
  height: 36px;
  padding: 5px 10px;
  font-size: 16px;
  line-height: 24px;
}
113 114 115 116 117 118 119 120 121 122 123 124 125 126

@mixin bulleted-list {
  > ul {
    list-style-type: disc;

    ul {
      list-style-type: circle;

      ul {
        list-style-type: square;
      }
    }
  }
}