_mixins-inherited.scss 8.33 KB
Newer Older
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
// studio - utilities - INHERITED mixins and extends

// NOTE: these are older/poorly architected mixins that we want to move away from using or refactor in the future.
// They are still referenced when styliing current interface elements and as such need to be preserved for the time being.
// talbs: we need to slowly ween ourselves off of these
// ====================


// line-height (old way)
@function lh($amount: 1) {
  @return $body-line-height * $amount;
}

// inherited - vertical and horizontal centering
@mixin vertically-and-horizontally-centered ($height, $width) {
  left: 50%;
  margin-left: -$width / 2;
  min-height: $height;
  min-width: $width;
  position: absolute;
  top: 150px;
}

// ====================

// inherited - dividers
.faded-hr-divider {
  @include background-image(linear-gradient(180deg, rgba(200,200,200, 0) 0%,
                                                    rgba(200,200,200, 1) 50%,
                                                    rgba(200,200,200, 0)));
  height: 1px;
  width: 100%;
}

.faded-hr-divider-medium {
  @include background-image(linear-gradient(180deg, rgba(240,240,240, 0) 0%,
                                                    rgba(240,240,240, 1) 50%,
                                                    rgba(240,240,240, 0)));
  height: 1px;
  width: 100%;
}

.faded-hr-divider-light {
  @include background-image(linear-gradient(180deg, rgba(255,255,255, 0) 0%,
                                                    rgba(255,255,255, 0.8) 50%,
                                                    rgba(255,255,255, 0)));
  height: 1px;
  width: 100%;
}

.faded-vertical-divider {
  @include background-image(linear-gradient(90deg, rgba(200,200,200, 0) 0%,
                                                    rgba(200,200,200, 1) 50%,
                                                    rgba(200,200,200, 0)));
  height: 100%;
  width: 1px;
}

.faded-vertical-divider-light {
  @include background-image(linear-gradient(90deg, rgba(255,255,255, 0) 0%,
                                                    rgba(255,255,255, 0.6) 50%,
                                                    rgba(255,255,255, 0)));
  height: 100%;
  width: 1px;
}

.vertical-divider {
  @extend .faded-vertical-divider;
  position: relative;

  &::after {
    @extend .faded-vertical-divider-light;
    content: "";
    display: block;
    position: absolute;
    left: 1px;
  }
}

.horizontal-divider {
  border: none;
  @extend .faded-hr-divider;
  position: relative;

  &::after {
    @extend .faded-hr-divider-light;
    content: "";
    display: block;
    position: absolute;
    top: 1px;
  }
}

.fade-right-hr-divider {
  @include background-image(linear-gradient(180deg, rgba(200,200,200, 0) 0%,
                                                    rgba(200,200,200, 1)));
  border: none;
}

.fade-left-hr-divider {
  @include background-image(linear-gradient(180deg, rgba(200,200,200, 1) 0%,
                                                    rgba(200,200,200, 0)));
  border: none;
}

// ====================

// inherited - ui
.window {
  @include clearfix();
  box-shadow: 0 1px 1px $shadow-l1;
  border-radius: 3px;
  margin-bottom: $baseline;
  border: 1px solid $gray-l2;
  background: $white;
}

// ====================

// mixins - grandfathered
@mixin button {
  @include transition(background-color 0.15s, box-shadow 0.15s);
123
  @extend %t-action3;
124
  @extend %t-strong;
125 126 127 128
  box-shadow: 0 1px 0 rgba(255, 255, 255, .3) inset, 0 0 0 rgba(0, 0, 0, 0);
  display: inline-block;
  padding: ($baseline/5) $baseline ($baseline/4);

129
  &.disabled, &.is-disabled {
130 131 132 133 134 135
    border: 1px solid $gray-l1 !important;
    border-radius: 3px !important;
    background: $gray-l1 !important;
    color: $gray-d1 !important;
    pointer-events: none;
    cursor: none;
136
    &:hover, &:focus {
137 138 139 140
      box-shadow: 0 0 0 0 !important;
    }
  }

141
  &:hover, &:focus, &:active {
142 143 144 145 146 147 148 149 150 151 152 153 154
    box-shadow: 0 1px 0 rgba(255, 255, 255, .3) inset, 0 1px 1px rgba(0, 0, 0, .15);
  }
}

@mixin green-button {
  @include button;
  @include linear-gradient(top, rgba(255, 255, 255, .3), rgba(255, 255, 255, 0));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .3) inset;
  border: 1px solid $green-d1;
  border-radius: 3px;
  background-color: $green;
  color: $white;

155
  &:hover, &:focus {
156 157 158 159
    background-color: $green-s1;
    color: $white;
  }

160
  &.disabled, &.is-disabled {
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
    border: 1px solid $green-l3 !important;
    background: $green-l3 !important;
    color: $white !important;
    box-shadow: none;
  }
}

@mixin blue-button {
  @include button;
  @include linear-gradient(top, rgba(255, 255, 255, .3), rgba(255, 255, 255, 0));
  border: 1px solid $blue-d1;
  border-radius: 3px;
  background-color: $blue;
  color: $white;

176
  &:hover, &:focus, &:active {
177 178 179 180
    background-color: $blue-s2;
    color: $white;
  }

181
  &.disabled, &.is-disabled {
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196
    box-shadow: none;
    border: 1px solid $blue-l3 !important;
    background: $blue-l3 !important;
    color: $white !important;
  }
}

@mixin red-button {
  @include button;
  @include linear-gradient(top, rgba(255, 255, 255, .3), rgba(255, 255, 255, 0));
  border: 1px solid $red-d1;
  border-radius: 3px;
  background-color: $red;
  color: $white;

197
  &:hover, &:focus, &:active {
198 199 200 201
    background-color: $red-s1;
    color: $white;
  }

202
  &.disabled, &.is-disabled {
203 204 205 206 207 208 209 210 211 212 213 214 215 216 217
    box-shadow: none;
    border: 1px solid $red-l3 !important;
    background: $red-l3 !important;
    color: $white !important;
  }
}

@mixin pink-button {
  @include button;
  @include linear-gradient(top, rgba(255, 255, 255, .3), rgba(255, 255, 255, 0));
  border: 1px solid $pink-d1;
  border-radius: 3px;
  background-color: $pink;
  color: $white;

218
  &:hover, &:focus, &:active {
219 220 221 222
    background-color: $pink-s1;
    color: $white;
  }

223
  &.disabled, &.is-disabled {
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
    box-shadow: none;
    border: 1px solid $pink-l3 !important;
    background: $pink-l3 !important;
    color: $white !important;
  }
}

@mixin orange-button {
  @include button;
  @include linear-gradient(top, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0) 60%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .3) inset;
  border: 1px solid $orange-d1;
  border-radius: 3px;
  background-color: $orange;
  color: $gray-d2;

240
  &:hover, &:focus {
241 242 243 244
    background-color: $orange-s2;
    color: $gray-d2;
  }

245
  &.disabled, &.is-disabled {
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262
    border: 1px solid $orange-l3 !important;
    background: $orange-l2 !important;
    color: $gray-l1 !important;
    box-shadow: none;
  }
}

@mixin white-button {
  @include button;
  @include linear-gradient(top, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .3) inset;
  border: 1px solid $mediumGrey;
  border-radius: 3px;
  background-color: #dfe5eb;
  color: rgb(92, 103, 122);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .5);

263
  &:hover, &:focus {
264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283
    background-color: rgb(222, 236, 247);
    color: rgb(92, 103, 122);
  }
}

@mixin grey-button {
  @include button;
  @include linear-gradient(top, rgba(255, 255, 255, .3), rgba(255, 255, 255, 0));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .3) inset;
  border: 1px solid $gray-d2;
  border-radius: 3px;
  background-color: #d1dae3;
  color: #6d788b;

  &:hover {
    background-color: #d9e3ee;
    color: #6d788b;
  }
}

284
.gray-button {
285 286 287 288 289 290 291 292
  @include button;
  @include linear-gradient(top, $white-t1, rgba(255, 255, 255, 0));
  box-shadow: 0 1px 0 $white-t1 inset;
  border: 1px solid $gray-d1;
  border-radius: 3px;
  background-color: $gray-d2;
  color: $gray-l3;

293
  &:hover, &:focus {
294 295 296 297 298
    background-color: $gray-d3;
    color: $white;
  }
}

299
// only needed for course updates
300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320
@mixin edit-box {
  box-shadow: 0 1px 0 rgba(255, 255, 255, .2) inset;
  padding: 15px 20px;
  border-radius: 3px;
  background-color: $lightBluishGrey2;
  color: #3c3c3c;

  label {
    color: $baseFontColor;
  }

  input,
  textarea {
    border: 1px solid $darkGrey;
  }

  textarea {
    min-height: 80px;
  }

  h5 {
321
    @extend %t-strong;
322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351
    margin-bottom: 8px;
    color: #fff;
  }

  .row {
    margin-bottom: 10px;
    padding: 0;
    border: none;
  }

  .save-button {
    @include blue-button;
    margin-top: 0;
  }

  .cancel-button {
    @include white-button;
    margin-top: 0;
  }
}

// ====================

// sunsetted mixins
@mixin active {
  @include linear-gradient(top, rgba(255, 255, 255, .4), rgba(255, 255, 255, 0));
  box-shadow: 0 -1px 0 rgba(0, 0, 0, .2) inset, 0 1px 0 #fff inset;
  background-color: rgba(255, 255, 255, .3);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}