Skip to content

Instantly share code, notes, and snippets.

View lunelson's full-sized avatar
👀
Reading

Lu Nelson lunelson

👀
Reading
View GitHub Profile
// ----
// libsass (v0.7.0)
// ----
@import "sass-list-maps";
@function single($unit) {
$units: 'em', 'ex', 'ch', 'rem', '%', 'vw', 'vh', 'vmin', 'vmax', 'cm', 'mm', 'in', 'px', 'pt', 'pc', 'deg', 'grad', 'rad', 'turn', 's', 'ms', 'dpi', 'dpcm', 'dppx';
$singles: 1em, 1ex, 1ch, 1rem, 1%, 1vw, 1vh, 1vmin, 1vmax, 1cm, 1mm, 1in, 1px, 1pt, 1pc, 1deg, 1grad, 1rad, 1turn, 1s, 1ms, 1dpi, 1dpcm, 1dppx;
$index: index($units, $unit); @if $index { @return nth($singles, $index); } @return 1; }
@lunelson
lunelson / SassMeister-input.scss
Created March 20, 2014 11:07
Draft for integrated Typesetting / MQ system
// ----
// libsass (v0.7.0)
// ----
@function single($unit) {
$units: 'em', 'ex', 'ch', 'rem', '%', 'vw', 'vh', 'vmin', 'vmax', 'cm', 'mm', 'in', 'px', 'pt', 'pc', 'deg', 'grad', 'rad', 'turn', 's', 'ms', 'dpi', 'dpcm', 'dppx';
$singles: 1em, 1ex, 1ch, 1rem, 1%, 1vw, 1vh, 1vmin, 1vmax, 1cm, 1mm, 1in, 1px, 1pt, 1pc, 1deg, 1grad, 1rad, 1turn, 1s, 1ms, 1dpi, 1dpcm, 1dppx;
$index: index($units, $unit); @if $index { @return nth($singles, $index); } @return 1; }
@function strip($value) { @return $value / single(unit($value)); }
@function assert($value, $unit) { @return strip($value) * single($unit); }
@lunelson
lunelson / SassMeister-input.scss
Created March 27, 2014 07:39
CURRENT SCRATCHPAD
// ----
// libsass (v0.7.0)
// ----
@import "sass-list-maps";
@mixin col-size($span, $offsets...) {
$n: nth($span, 1); $d: nth($span, 2);
width: $n / $d * 100%;
@each $offset in $offsets {
@lunelson
lunelson / SassMeister-input.scss
Created March 27, 2014 07:44
Error example, for support.mixture.io
// ----
// libsass (v0.7.0)
// ----
@mixin col-size($span, $offsets...) {
$n: nth($span, 1); $d: nth($span, 2);
width: $n / $d * 100%;
@each $offset in $offsets {
$dir: nth($offset, 1); $o: nth($offset, 2);
@if length($offset) > 2 { $d: nth($offset, 3); }
@lunelson
lunelson / SassMeister-input.scss
Created April 3, 2014 08:04
Original basic query-status-tracking mixin
// ----
// Sass (v3.3.4)
// Compass (v1.0.0.alpha.18)
// ----
$in-query: false;
@mixin mq($mq-string) {
$in-query: true;
@media #{$mq-string} {
@lunelson
lunelson / SassMeister-input.scss
Created April 9, 2014 11:57
Some new sketches
// ----
// libsass (v0.7.0)
// ----
/*
what we want
tscale function
interp function
new calcs of compensated typographic margins
- natural-line-height vs compensated-line-height subtractions
@lunelson
lunelson / SassMeister-input.scss
Created April 17, 2014 19:07
Dev Sketch for Map-Pretty
// ----
// libsass (v0.7.0)
// ----
@import "sass-list-maps";
/*
SASS-LIST-MAPS
a development sketch - more info at https://github.com/lunelson/sass-list-maps
@lunelson
lunelson / SassMeister-input.scss
Created May 3, 2014 16:54
Sketch for a new size / margin / query calculation system
// ----
// libsass (v0.7.0)
// ----
@import "sass-list-maps";
$sizes: (
'h4-sm' (
'fz' 0.9rem,
'tt' -0.1em,
@lunelson
lunelson / SassMeister-input.scss
Created May 6, 2014 18:50
Bug report re: Libsass
// ----
// libsass (v0.7.0)
// ----
/*
Libsass bug: splat arguments
it seems you can't pass splat list arguments
to aliased functions under certain conditions
*/
@lunelson
lunelson / SassMeister-input.scss
Last active August 29, 2015 14:01
CONDITIONAL INCLUDE/EXTEND
// media query mixin which tracks in/out status
$query: false;
@mixin mq($mq-string) {
$query: true;
@media #{$mq-string} { @content; }
$query: false;
}
// conditional mixin
@mixin inline-block($output: false) {