Skip to content

Instantly share code, notes, and snippets.

@jakob-e
jakob-e / input.scss
Created January 24, 2021 11:20
Generated by SassMeister.com.
// ----------------------------------------
// emulate include-context
// ----------------------------------------
$include-context-list: ();
@mixin include-context($name){
$include-context-list: append($include-context-list, $name, comma) !global;
@content;
$include-context-list: nth-remove($include-context-list, -1) !global;
}
@function include-context(){
@jakob-e
jakob-e / input.scss
Last active January 24, 2021 11:19
Generated by SassMeister.com.
// ----------------------------------------
// emulate mixin-context
// ----------------------------------------
$mixin-context-list: ();
@mixin mixin-context($name){
$mixin-context-list: append($mixin-context-list, $name, comma) !global;
@content;
$mixin-context-list: nth-remove($mixin-context-list, -1) !global;
}
@function mixin-context(){
@jakob-e
jakob-e / input.scss
Last active January 24, 2021 10:59
Generated by SassMeister.com.
// ----------------------------------------
$trace-list: ();
@mixin trace($name){
$trace-list: append($trace-list, $name, comma) !global;
@content;
$trace-list: nth-remove($trace-list, -1) !global;
}
@function nth-remove($list, $n){
$r: ();$n: if($n < 0, length($list) + $n + 1, $n); $b: is-bracketed($list); $s: list-separator($list);
@for $i from 1 through length($list){ @if $i != $n { $r: append($r, nth($list, $i)); }}
@jakob-e
jakob-e / input.scss
Created January 24, 2021 10:38
Generated by SassMeister.com.
// ----------------------------------------
$trace-list: ();
@mixin trace($name){
$trace-list: append($trace-list, $name, comma) !global;
@content;
$trace-list: nth-remove($trace-list, -1) !global;
}
@function nth-remove($list, $n){
$r: ();$n: if($n < 0, length($list) + $n + 1, $n); $b: is-bracketed($list); $s: list-separator($list);
@for $i from 1 through length($list){ @if $i != $n { $r: append($r, nth($list, $i)); }}
@jakob-e
jakob-e / input.scss
Created January 20, 2021 16:37
Generated by SassMeister.com.
$once: ();
@mixin once($key){
@if not index($once, $key){
$once: append($once, $key) !global;
@content;
}
}
@jakob-e
jakob-e / object-fit.js
Created November 4, 2018 23:39
object-fit for ie9+ (image only)
// is object fit supported
if (document.body.style.objectFit === undefined) {
// loop through all images
[].slice
.call(document.querySelectorAll('img'))
.map(img => {
// image has background-size cover or contain
// ––––––––––––––––––––––––––––––––––––––––––––––––––
// frankly
//
// font-smoothing
// font-size
//
// ––––––––––––––––––––––––––––––––––––––––––––––––––
@jakob-e
jakob-e / SassMeister-input.scss
Last active November 6, 2017 15:08
Generated by SassMeister.com.
// ____________________________________________________________________________
//
// SCSS Unit Conversion v.2.1.2
//
//
// Links:
// GitHub https://github.com/jakob-e/unitconversion
// Codepen https://codepen.io/jakob-e/pen/AHunv
// ____________________________________________________________________________
//
@jakob-e
jakob-e / _animate.scss
Last active December 12, 2015 14:55
SCSS mixin based on Animate.css (Autoprefixer required)
// -----------------------------------------------------------------------
//
// SCSS mixin based on Animate.css
//
// Animate.css http://daneden.github.io/animate.css
// Licensed under the MIT license - http://opensource.org/licenses/MIT
// Copyright (c) 2015 Daniel Eden
//
// -----------------------------------------------------------------------
//
@jakob-e
jakob-e / SassMeister-input-HTML.html
Last active December 7, 2015 10:25
Generated by SassMeister.com.
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
<li>7</li>
<li>8</li>
<li>9</li>