_bourbon-deprecated-upcoming.scss 14.2 KB
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 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 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 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411
// The following features have been deprecated and will be removed in the next MAJOR version release

@mixin inline-block {
  display: inline-block;

  @warn "The inline-block mixin is deprecated and will be removed in the next major version release";
}

@mixin button ($style: simple, $base-color: #4294f0, $text-size: inherit, $padding: 7px 18px) {

  @if type-of($style) == string and type-of($base-color) == color {
    @include buttonstyle($style, $base-color, $text-size, $padding);
  }

  @if type-of($style) == string and type-of($base-color) == number {
    $padding: $text-size;
    $text-size: $base-color;
    $base-color: #4294f0;

    @if $padding == inherit {
      $padding: 7px 18px;
    }

    @include buttonstyle($style, $base-color, $text-size, $padding);
  }

  @if type-of($style) == color and type-of($base-color) == color {
    $base-color: $style;
    $style: simple;
    @include buttonstyle($style, $base-color, $text-size, $padding);
  }

  @if type-of($style) == color and type-of($base-color) == number {
    $padding: $text-size;
    $text-size: $base-color;
    $base-color: $style;
    $style: simple;

    @if $padding == inherit {
      $padding: 7px 18px;
    }

    @include buttonstyle($style, $base-color, $text-size, $padding);
  }

  @if type-of($style) == number {
    $padding: $base-color;
    $text-size: $style;
    $base-color: #4294f0;
    $style: simple;

    @if $padding == #4294f0 {
      $padding: 7px 18px;
    }

    @include buttonstyle($style, $base-color, $text-size, $padding);
  }

  &:disabled {
    cursor: not-allowed;
    opacity: 0.5;
  }

  @warn "The button mixin is deprecated and will be removed in the next major version release";
}

// Selector Style Button
@mixin buttonstyle($type, $b-color, $t-size, $pad) {
  // Grayscale button
  @if $type == simple and $b-color == grayscale($b-color) {
    @include simple($b-color, true, $t-size, $pad);
  }

  @if $type == shiny and $b-color == grayscale($b-color) {
    @include shiny($b-color, true, $t-size, $pad);
  }

  @if $type == pill and $b-color == grayscale($b-color) {
    @include pill($b-color, true, $t-size, $pad);
  }

  @if $type == flat and $b-color == grayscale($b-color) {
    @include flat($b-color, true, $t-size, $pad);
  }

  // Colored button
  @if $type == simple {
    @include simple($b-color, false, $t-size, $pad);
  }

  @else if $type == shiny {
    @include shiny($b-color, false, $t-size, $pad);
  }

  @else if $type == pill {
    @include pill($b-color, false, $t-size, $pad);
  }

  @else if $type == flat {
    @include flat($b-color, false, $t-size, $pad);
  }
}

// Simple Button
@mixin simple($base-color, $grayscale: false, $textsize: inherit, $padding: 7px 18px) {
  $color:         hsl(0, 0, 100%);
  $border:        adjust-color($base-color, $saturation:  9%,  $lightness: -14%);
  $inset-shadow:  adjust-color($base-color, $saturation: -8%,  $lightness:  15%);
  $stop-gradient: adjust-color($base-color, $saturation:  9%,  $lightness: -11%);
  $text-shadow:   adjust-color($base-color, $saturation:  15%, $lightness: -18%);

  @if is-light($base-color) {
    $color:       hsl(0, 0, 20%);
    $text-shadow: adjust-color($base-color, $saturation: 10%, $lightness: 4%);
  }

  @if $grayscale == true {
    $border:        grayscale($border);
    $inset-shadow:  grayscale($inset-shadow);
    $stop-gradient: grayscale($stop-gradient);
    $text-shadow:   grayscale($text-shadow);
  }

  border: 1px solid $border;
  border-radius: 3px;
  box-shadow: inset 0 1px 0 0 $inset-shadow;
  color: $color;
  display: inline-block;
  font-size: $textsize;
  font-weight: bold;
  @include linear-gradient ($base-color, $stop-gradient);
  padding: $padding;
  text-decoration: none;
  text-shadow: 0 1px 0 $text-shadow;
  background-clip: padding-box;

  &:hover:not(:disabled) {
    $base-color-hover:    adjust-color($base-color, $saturation: -4%, $lightness: -5%);
    $inset-shadow-hover:  adjust-color($base-color, $saturation: -7%, $lightness:  5%);
    $stop-gradient-hover: adjust-color($base-color, $saturation:  8%, $lightness: -14%);

    @if $grayscale == true {
      $base-color-hover:    grayscale($base-color-hover);
      $inset-shadow-hover:  grayscale($inset-shadow-hover);
      $stop-gradient-hover: grayscale($stop-gradient-hover);
    }

    @include linear-gradient ($base-color-hover, $stop-gradient-hover);

    box-shadow: inset 0 1px 0 0 $inset-shadow-hover;
    cursor: pointer;
  }

  &:active:not(:disabled),
  &:focus:not(:disabled) {
    $border-active:       adjust-color($base-color, $saturation: 9%, $lightness: -14%);
    $inset-shadow-active: adjust-color($base-color, $saturation: 7%, $lightness: -17%);

    @if $grayscale == true {
      $border-active:       grayscale($border-active);
      $inset-shadow-active: grayscale($inset-shadow-active);
    }

    border: 1px solid $border-active;
    box-shadow: inset 0 0 8px 4px $inset-shadow-active, inset 0 0 8px 4px $inset-shadow-active;
  }
}

// Shiny Button
@mixin shiny($base-color, $grayscale: false, $textsize: inherit, $padding: 7px 18px) {
  $color:         hsl(0, 0, 100%);
  $border:        adjust-color($base-color, $red: -117, $green: -111, $blue: -81);
  $border-bottom: adjust-color($base-color, $red: -126, $green: -127, $blue: -122);
  $fourth-stop:   adjust-color($base-color, $red: -79,  $green: -70,  $blue: -46);
  $inset-shadow:  adjust-color($base-color, $red:  37,  $green:  29,  $blue:  12);
  $second-stop:   adjust-color($base-color, $red: -56,  $green: -50,  $blue: -33);
  $text-shadow:   adjust-color($base-color, $red: -140, $green: -141, $blue: -114);
  $third-stop:    adjust-color($base-color, $red: -86,  $green: -75,  $blue: -48);

  @if is-light($base-color) {
    $color:       hsl(0, 0, 20%);
    $text-shadow: adjust-color($base-color, $saturation: 10%, $lightness: 4%);
  }

  @if $grayscale == true {
    $border:        grayscale($border);
    $border-bottom: grayscale($border-bottom);
    $fourth-stop:   grayscale($fourth-stop);
    $inset-shadow:  grayscale($inset-shadow);
    $second-stop:   grayscale($second-stop);
    $text-shadow:   grayscale($text-shadow);
    $third-stop:    grayscale($third-stop);
  }

  @include linear-gradient(top, $base-color 0%, $second-stop 50%, $third-stop 50%, $fourth-stop 100%);

  border: 1px solid $border;
  border-bottom: 1px solid $border-bottom;
  border-radius: 5px;
  box-shadow: inset 0 1px 0 0 $inset-shadow;
  color: $color;
  display: inline-block;
  font-size: $textsize;
  font-weight: bold;
  padding: $padding;
  text-align: center;
  text-decoration: none;
  text-shadow: 0 -1px 1px $text-shadow;

  &:hover:not(:disabled) {
    $first-stop-hover:  adjust-color($base-color, $red: -13, $green: -15, $blue: -18);
    $second-stop-hover: adjust-color($base-color, $red: -66, $green: -62, $blue: -51);
    $third-stop-hover:  adjust-color($base-color, $red: -93, $green: -85, $blue: -66);
    $fourth-stop-hover: adjust-color($base-color, $red: -86, $green: -80, $blue: -63);

    @if $grayscale == true {
      $first-stop-hover:  grayscale($first-stop-hover);
      $second-stop-hover: grayscale($second-stop-hover);
      $third-stop-hover:  grayscale($third-stop-hover);
      $fourth-stop-hover: grayscale($fourth-stop-hover);
    }

    @include linear-gradient(top, $first-stop-hover  0%,
                                  $second-stop-hover 50%,
                                  $third-stop-hover  50%,
                                  $fourth-stop-hover 100%);
    cursor: pointer;
  }

  &:active:not(:disabled),
  &:focus:not(:disabled) {
    $inset-shadow-active: adjust-color($base-color, $red: -111, $green: -116, $blue: -122);

    @if $grayscale == true {
      $inset-shadow-active: grayscale($inset-shadow-active);
    }

    box-shadow: inset 0 0 20px 0 $inset-shadow-active;
  }
}

// Pill Button
@mixin pill($base-color, $grayscale: false, $textsize: inherit, $padding: 7px 18px) {
  $color:         hsl(0, 0, 100%);
  $border-bottom: adjust-color($base-color, $hue:  8, $saturation: -11%, $lightness: -26%);
  $border-sides:  adjust-color($base-color, $hue:  4, $saturation: -21%, $lightness: -21%);
  $border-top:    adjust-color($base-color, $hue: -1, $saturation: -30%, $lightness: -15%);
  $inset-shadow:  adjust-color($base-color, $hue: -1, $saturation: -1%,  $lightness:  7%);
  $stop-gradient: adjust-color($base-color, $hue:  8, $saturation:  14%, $lightness: -10%);
  $text-shadow:   adjust-color($base-color, $hue:  5, $saturation: -19%, $lightness: -15%);

  @if is-light($base-color) {
    $color:       hsl(0, 0, 20%);
    $text-shadow: adjust-color($base-color, $saturation: 10%, $lightness: 4%);
  }

  @if $grayscale == true {
    $border-bottom: grayscale($border-bottom);
    $border-sides:  grayscale($border-sides);
    $border-top:    grayscale($border-top);
    $inset-shadow:  grayscale($inset-shadow);
    $stop-gradient: grayscale($stop-gradient);
    $text-shadow:   grayscale($text-shadow);
  }

  border: 1px solid $border-top;
  border-color: $border-top $border-sides $border-bottom;
  border-radius: 16px;
  box-shadow: inset 0 1px 0 0 $inset-shadow;
  color: $color;
  display: inline-block;
  font-size: $textsize;
  font-weight: normal;
  line-height: 1;
  @include linear-gradient ($base-color, $stop-gradient);
  padding: $padding;
  text-align: center;
  text-decoration: none;
  text-shadow: 0 -1px 1px $text-shadow;
  background-clip: padding-box;

  &:hover:not(:disabled) {
    $base-color-hover:    adjust-color($base-color,                                $lightness: -4.5%);
    $border-bottom:       adjust-color($base-color, $hue:  8, $saturation:  13.5%, $lightness: -32%);
    $border-sides:        adjust-color($base-color, $hue:  4, $saturation: -2%,    $lightness: -27%);
    $border-top:          adjust-color($base-color, $hue: -1, $saturation: -17%,   $lightness: -21%);
    $inset-shadow-hover:  adjust-color($base-color,           $saturation: -1%,    $lightness:  3%);
    $stop-gradient-hover: adjust-color($base-color, $hue:  8, $saturation: -4%,    $lightness: -15.5%);
    $text-shadow-hover:   adjust-color($base-color, $hue:  5, $saturation: -5%,    $lightness: -22%);

    @if $grayscale == true {
      $base-color-hover:    grayscale($base-color-hover);
      $border-bottom:       grayscale($border-bottom);
      $border-sides:        grayscale($border-sides);
      $border-top:          grayscale($border-top);
      $inset-shadow-hover:  grayscale($inset-shadow-hover);
      $stop-gradient-hover: grayscale($stop-gradient-hover);
      $text-shadow-hover:   grayscale($text-shadow-hover);
    }

    @include linear-gradient ($base-color-hover, $stop-gradient-hover);

    background-clip: padding-box;
    border: 1px solid $border-top;
    border-color: $border-top $border-sides $border-bottom;
    box-shadow: inset 0 1px 0 0 $inset-shadow-hover;
    cursor: pointer;
    text-shadow: 0 -1px 1px $text-shadow-hover;
  }

  &:active:not(:disabled),
  &:focus:not(:disabled) {
    $active-color:         adjust-color($base-color, $hue: 4,  $saturation: -12%,  $lightness: -10%);
    $border-active:        adjust-color($base-color, $hue: 6,  $saturation: -2.5%, $lightness: -30%);
    $border-bottom-active: adjust-color($base-color, $hue: 11, $saturation:  6%,   $lightness: -31%);
    $inset-shadow-active:  adjust-color($base-color, $hue: 9,  $saturation:  2%,   $lightness: -21.5%);
    $text-shadow-active:   adjust-color($base-color, $hue: 5,  $saturation: -12%,  $lightness: -21.5%);

    @if $grayscale == true {
      $active-color:         grayscale($active-color);
      $border-active:        grayscale($border-active);
      $border-bottom-active: grayscale($border-bottom-active);
      $inset-shadow-active:  grayscale($inset-shadow-active);
      $text-shadow-active:   grayscale($text-shadow-active);
    }

    background: $active-color;
    border: 1px solid $border-active;
    border-bottom: 1px solid $border-bottom-active;
    box-shadow: inset 0 0 6px 3px $inset-shadow-active;
    text-shadow: 0 -1px 1px $text-shadow-active;
  }
}

// Flat Button
@mixin flat($base-color, $grayscale: false, $textsize: inherit, $padding: 7px 18px) {
  $color:         hsl(0, 0, 100%);

  @if is-light($base-color) {
    $color:       hsl(0, 0, 20%);
  }

  background-color: $base-color;
  border-radius: 3px;
  border: 0;
  color: $color;
  display: inline-block;
  font-size: $textsize;
  font-weight: bold;
  padding: $padding;
  text-decoration: none;
  background-clip: padding-box;

  &:hover:not(:disabled){
    $base-color-hover:    adjust-color($base-color, $saturation: 4%, $lightness: 5%);

    @if $grayscale == true {
      $base-color-hover: grayscale($base-color-hover);
    }

    background-color: $base-color-hover;
    cursor: pointer;
  }

  &:active:not(:disabled),
  &:focus:not(:disabled) {
    $base-color-active: adjust-color($base-color, $saturation: -4%, $lightness: -5%);

    @if $grayscale == true {
      $base-color-active: grayscale($base-color-active);
    }

    background-color: $base-color-active;
    cursor: pointer;
  }
}

// Flexible grid
@function flex-grid($columns, $container-columns: $fg-max-columns) {
  $width: $columns * $fg-column + ($columns - 1) * $fg-gutter;
  $container-width: $container-columns * $fg-column + ($container-columns - 1) * $fg-gutter;
  @return percentage($width / $container-width);

  @warn "The flex-grid function is deprecated and will be removed in the next major version release";
}

// Flexible gutter
@function flex-gutter($container-columns: $fg-max-columns, $gutter: $fg-gutter) {
  $container-width: $container-columns * $fg-column + ($container-columns - 1) * $fg-gutter;
  @return percentage($gutter / $container-width);

  @warn "The flex-gutter function is deprecated and will be removed in the next major version release";
}

@function grid-width($n) {
  @return $n * $gw-column + ($n - 1) * $gw-gutter;

  @warn "The grid-width function is deprecated and will be removed in the next major version release";
}

@function golden-ratio($value, $increment) {
  @return modular-scale($increment, $value, $ratio: $golden);

  @warn "The golden-ratio function is deprecated and will be removed in the next major version release. Please use the modular-scale function, instead.";
}

@mixin box-sizing($box) {
  @include prefixer(box-sizing, $box, webkit moz spec);

  @warn "The box-sizing mixin is deprecated and will be removed in the next major version release. This property can now be used un-prefixed.";
}