Skip to content

Instantly share code, notes, and snippets.

Avatar

Jakob Eriksen jakob-e

View GitHub Profile
@jakob-e
jakob-e / input.scss
Created Jan 24, 2021
Generated by SassMeister.com.
View input.scss
// ----------------------------------------
// 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 Jan 24, 2021
Generated by SassMeister.com.
View input.scss
// ----------------------------------------
// 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 Jan 24, 2021
Generated by SassMeister.com.
View input.scss
// ----------------------------------------
$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 Jan 24, 2021
Generated by SassMeister.com.
View input.scss
// ----------------------------------------
$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 Jan 20, 2021
Generated by SassMeister.com.
View input.scss
$once: ();
@mixin once($key){
@if not index($once, $key){
$once: append($once, $key) !global;
@content;
}
}
@jakob-e
jakob-e / object-fit.js
Created Nov 4, 2018
object-fit for ie9+ (image only)
View object-fit.js
// 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
View _frankly.scss
// ––––––––––––––––––––––––––––––––––––––––––––––––––
// frankly
//
// font-smoothing
// font-size
//
// ––––––––––––––––––––––––––––––––––––––––––––––––––
@jakob-e
jakob-e / SassMeister-input.scss
Last active Nov 6, 2017
Generated by SassMeister.com.
View SassMeister-input.scss
// ____________________________________________________________________________
//
// 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 Dec 12, 2015
SCSS mixin based on Animate.css (Autoprefixer required)
View _animate.scss
// -----------------------------------------------------------------------
//
// 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 Dec 7, 2015
Generated by SassMeister.com.
View SassMeister-input-HTML.html
<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>