Snippets Collections
/// Apply `$function` with `$args` to each item from `$list`.
/// @author Kitty Giraudel
/// @param {List} $list - List of items
/// @param {String} $function - Function to apply to every item from `$list`
/// @param {Arglist} $args - Extra arguments to pass to `$function`
/// @return {List}
/// @throw There is no `#{$function}` function.
@function walk($list, $function, $args...) {
  @if not function-exists($function) {
    @error "There is no `#{$function}` function.";
  }
  
  @for $i from 1 through length($list) {
    $list: set-nth($list, $i, call($function, nth($list, $i), $args...));
  }
  
  @return $list;
}
@mixin light-mode {
	@media (prefers-color-scheme: light) {
      @content;
    }
}
@mixin animete-reduce {
  @media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
      animation-delay: -1ms !important;
      animation-duration: 1ms !important;
      animation-iteration-count: 1 !important;
      background-attachment: initial !important;
      scroll-behavior: auto !important;
      transition-delay: 0s !important;
      transition-duration: 0s !important;
    }
  }
}
@mixin dark-mode {
  @media (prefers-color-scheme: dark) {
    @content;
  }
}
@function rem-calc($size) {
  $remSize: $size / 16px;
  @return #{$remSize}rem;
}
html,

body {

  width: 0%;

  height: 100%;

  display: flex;

}

​

.wrapper {

  position: relative;
10
  margin: auto;

}

​

.cyclist {

  width: 48px;

  height: 48px;

  position: absolute;

  transform: translateY(-50%);  // position the rider above the curve. could be done with offset-position but it has no browser support yet

  offset-path: path("M1 260C65.034 260.999 102.054 253.632 130.069 241.15C158.083 228.668 177.093 244.645 1.612 258.125C246.13 271.606 296.157 293.574 342.181 258.125C388.6 222.677 405.715 140.297 479.754 139.798C553.793 139.298 591.313 207.699 667.854 258.125C744.395 308.552 782.416 287.783 802.425 269.608C846.949 229.167 924.49 109.841 943 1");

  animation: ride-hills 10s ease-in infinite;
20
}
21
​
.iframe-container {
      // overflow: hidden;
      // /* 16:9 aspect ratio */
      // padding-top: 56.25%;
      // position: relative;
      width: 100%;
      padding-top: 100%;
      position: relative;
      iframe {
         // border: 0;
         // height: 100%;
         // left: 0;
         // position: absolute;
         // top: 0;
         // width: 100%;
         position: absolute;
         top: 0;
         left: 0;
         width: 100%;
         height: 100%;
      }
    }
/// Remove the unit of a length
/// @param {Number} $number - Number to remove unit from
/// @return {Number} - Unitless number
@function strip-unit($number) {
  @if type-of($number) == 'number' and not unitless($number) {
    @return $number / ($number * 0 + 1);
  }

  @return $number;
}
star

Sat Aug 07 2021 19:12:50 GMT+0000 (UTC) https://css-tricks.com/snippets/sass/functional-programming-functions/

#scss
star

Thu Jun 17 2021 10:25:10 GMT+0000 (UTC)

#scss
star

Thu Jun 17 2021 10:22:34 GMT+0000 (UTC)

#scss
star

Thu Jun 17 2021 10:17:34 GMT+0000 (UTC)

#scss
star

Tue May 18 2021 16:42:43 GMT+0000 (UTC)

#scss #sass
star

Thu Apr 29 2021 08:10:01 GMT+0000 (UTC) https://codepen.io/Chokcoco/pen/dyNaZea

#scss
star

Thu Apr 22 2021 11:54:21 GMT+0000 (UTC)

#css #scss
star

Fri Dec 25 2020 06:21:21 GMT+0000 (UTC) https://css-tricks.com/snippets/sass/strip-unit-function/

#scss

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension