gitlab-theme.scss 5.39 KB
Newer Older
1 2 3 4 5 6 7
/**
 * Styles the GitLab application with a specific color theme
 */

@mixin gitlab-theme($color-100, $color-200, $color-500, $color-700, $color-800, $color-900, $color-alternate) {
  // Header

Annabel Dunstone Gray's avatar
Annabel Dunstone Gray committed
8
  .navbar-gitlab {
9
    background-color: $color-900;
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

    .navbar-collapse {
      color: $color-200;
    }

    .container-fluid {
      .navbar-toggle {
        border-left: 1px solid lighten($color-700, 10%);
      }
    }

    .navbar-sub-nav,
    .navbar-nav {
      > li {
        > a:hover,
        > a:focus {
          background-color: rgba($color-200, .2);
        }

        &.active > a,
        &.dropdown.open > a {
          color: $color-900;
          background-color: $color-alternate;

          svg {
            fill: currentColor;
          }
        }

        &.line-separator {
          border-left: 1px solid rgba($color-200, .2);
        }
      }
    }

    .navbar-sub-nav {
      color: $color-200;
    }

    .nav {
      > li {
        color: $color-200;

        > a {
          svg {
            fill: $color-200;
          }

          &.header-user-dropdown-toggle {
            .header-user-avatar {
              border-color: $color-200;
            }
          }

          &:hover,
          &:focus {
            @media (min-width: $screen-sm-min) {
              background-color: rgba($color-200, .2);
            }

            svg {
              fill: currentColor;
            }
          }
        }

        &.active > a,
        &.dropdown.open > a {
          color: $color-900;
          background-color: $color-alternate;

          &:hover {
            svg {
              fill: $color-900;
            }
          }
        }

        .impersonated-user,
        .impersonated-user:hover {
          svg {
            fill: $color-900;
          }
        }
      }
    }
  }

98
  .navbar .title {
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
    > a {
      &:hover,
      &:focus {
        background-color: rgba($color-200, .2);
      }
    }
  }

  .search {
    form {
      background-color: rgba($color-200, .2);

      &:hover {
        background-color: rgba($color-200, .3);
      }
    }

    .location-badge {
      color: $color-100;
      background-color: rgba($color-200, .1);
      border-right: 1px solid $color-800;
    }

    .search-input::placeholder {
      color: rgba($color-200, .8);
    }

    .search-input-wrap {
      .search-icon,
      .clear-icon {
129
        fill: rgba($color-200, .8);
130 131 132 133 134 135 136 137 138 139 140 141 142 143
      }
    }

    &.search-active {
      form {
        background-color: $white-light;
      }

      .location-badge {
        color: $gl-text-color;
      }

      .search-input-wrap {
        .search-icon {
144
          fill: rgba($color-200, .8);
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
        }
      }
    }
  }

  .btn-sign-in {
    background-color: $color-100;
    color: $color-900;
  }


  // Sidebar
  .nav-sidebar li.active {
    box-shadow: inset 4px 0 0 $color-700;

    > a {
161
      color: $color-800;
162 163 164
    }

    svg {
165 166 167 168 169 170 171 172 173 174 175 176 177
      fill: $color-800;
    }
  }

  .sidebar-top-level-items > li.active .badge {
    color: $color-800;
  }

  .nav-links li.active a {
    border-bottom-color: $color-500;

    .badge {
      font-weight: $gl-font-weight-bold;
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202
    }
  }
}


body {
  &.ui_indigo {
    @include gitlab-theme($indigo-100, $indigo-200, $indigo-500, $indigo-700, $indigo-800, $indigo-900, $white-light);
  }

  &.ui_dark {
    @include gitlab-theme($theme-gray-100, $theme-gray-200, $theme-gray-500, $theme-gray-700, $theme-gray-800, $theme-gray-900, $white-light);
  }

  &.ui_blue {
    @include gitlab-theme($theme-blue-100, $theme-blue-200, $theme-blue-500, $theme-blue-700, $theme-blue-800, $theme-blue-900, $white-light);
  }

  &.ui_green {
    @include gitlab-theme($theme-green-100, $theme-green-200, $theme-green-500, $theme-green-700, $theme-green-800, $theme-green-900, $white-light);
  }

  &.ui_light {
    @include gitlab-theme($theme-gray-900, $theme-gray-700, $theme-gray-800, $theme-gray-700, $theme-gray-700, $theme-gray-100, $theme-gray-700);

Annabel Dunstone Gray's avatar
Annabel Dunstone Gray committed
203
    .navbar-gitlab {
204
      background-color: $theme-gray-100;
Annabel Dunstone Gray's avatar
Annabel Dunstone Gray committed
205
      box-shadow: 0 1px 0 0 $border-color;
206 207 208 209 210 211 212 213 214 215 216 217 218

      .logo-text svg {
        fill: $theme-gray-900;
      }

      .navbar-sub-nav,
      .navbar-nav {
        > li {
          > a:hover,
          > a:focus {
            color: $theme-gray-900;
          }

219 220
          &.active > a,
          &.active > a:hover {
221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241
            color: $white-light;
          }
        }
      }

      .container-fluid {
        .navbar-toggle,
        .navbar-toggle:hover {
          color: $theme-gray-700;
          border-left: 1px solid $theme-gray-200;
        }
      }
    }

    .search {
      form {
        background-color: $white-light;
        box-shadow: inset 0 0 0 1px $border-color;

        &:hover {
          background-color: $white-light;
242
          box-shadow: inset 0 0 0 1px $blue-200;
243 244

          .location-badge {
245
            box-shadow: inset 0 0 0 1px $blue-200;
246 247 248 249 250 251
          }
        }
      }

      .search-input-wrap {
        .search-icon {
252
          fill: $theme-gray-200;
253
        }
254 255 256 257

        .search-input {
          color: $gl-text-color;
        }
258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276
      }

      .location-badge {
        color: $theme-gray-700;
        box-shadow: inset 0 0 0 1px $border-color;
        background-color: $nav-badge-bg;
        border-right: 0;
      }
    }

    .nav-sidebar li.active {
      > a {
        color: $theme-gray-900;
      }

      svg {
        fill: $theme-gray-900;
      }
    }
277 278 279 280

    .sidebar-top-level-items > li.active .badge {
      color: $theme-gray-900;
    }
281 282
  }
}