Skip to content

Instantly share code, notes, and snippets.

@ezekg
Created July 18, 2014 13:50
Show Gist options
  • Save ezekg/8dd68eefc26775749414 to your computer and use it in GitHub Desktop.
Save ezekg/8dd68eefc26775749414 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.3.10)
// Compass (v1.0.0.alpha.20)
// Flint (v1.7.1)
// True (v0.2.0)
// ----
@import "flint";
@import "true";
parent {
@include _(4);
child {
@include _(2, auto);
}
}
@function reset-instances() {
$flint__instances: () !global;
@return $flint__instances;
}
@include test-module("Column Math") {
// Width math
// ----
@include test("[function] calc-width()") {
$width: flint-calc-width("desktop", 1);
@include assert-equal(
$width, 6.25%,
"Column percentage should equal $width."
);
}
// Margin math
// ----
@include test("[function] calc-margin()") {
$margin: flint-calc-margin("desktop", 1);
@include assert-equal(
$margin, 0.78125%,
"Margin percentage should be equal to $margin."
);
}
// Breakpoint getters
// ----
@include test("[function] calc-breakpoint()") {
$breakpoint-alias: flint-calc-breakpoint("alias", "desktop", 1);
@include assert-equal(
$breakpoint-alias, 80em,
"Desktop's breakpoint shoud be equal to $breakpoint-alias."
);
$breakpoint-next: flint-calc-breakpoint("next", "desktop", 1);
@include assert-equal(
$breakpoint-next, 60em,
"Desktop's next breakpoint shoud be equal to $breakpoint-next."
);
$breakpoint-prev: flint-calc-breakpoint("prev", "desktop", 1);
@include assert-equal(
$breakpoint-prev, 80em,
"Desktop's previous breakpoint shoud be equal to $breakpoint-prev."
);
}
// Instance tests
// ----
@include test("Instance output") {
$desktop-width: flint-map-fetch($flint__instances, "parent::desktop" "output" "width");
@include assert-equal(
$desktop-width, "23.4375%",
"Instance width should be equal to $desktop-width."
);
$laptop-breakpoint: flint-map-fetch($flint__instances, "parent::laptop" "breakpoint");
@include assert-equal(
$laptop-breakpoint, "60em",
"Instance breakpoint should be equal to $laptop-breakpoint."
);
$desktop-parent-has-parent: flint-map-fetch($flint__instances, "parent::desktop" "parent-selector");
@include assert-equal(
$desktop-parent-has-parent, "none",
"Instance parent should not have parent."
);
$desktop-child-has-parent: flint-map-fetch($flint__instances, "parent child::desktop" "parent-selector");
@include assert-equal(
$desktop-child-has-parent, "parent::desktop",
"Instance parent should have parent."
);
}
}
parent {
display: block;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
float: left;
width: 93.75%;
margin-right: 3.125%;
margin-left: 3.125%;
}
@media only screen and (min-width: 60.0625em) {
parent {
width: 23.4375%;
margin-right: 0.78125%;
margin-left: 0.78125%;
}
}
@media only screen and (min-width: 40.0625em) and (max-width: 60em) {
parent {
width: 31.25%;
margin-right: 1.04167%;
margin-left: 1.04167%;
}
}
@media only screen and (min-width: 20.0625em) and (max-width: 40em) {
parent {
width: 46.875%;
margin-right: 1.5625%;
margin-left: 1.5625%;
}
}
parent child {
display: block;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
float: left;
width: 43.75%;
margin-right: 3.125%;
margin-left: 3.125%;
}
@media only screen and (min-width: 60.0625em) {
parent child {
width: 43.75%;
margin-right: 3.125%;
margin-left: 3.125%;
}
}
@media only screen and (min-width: 40.0625em) and (max-width: 60em) {
parent child {
width: 43.75%;
margin-right: 3.125%;
margin-left: 3.125%;
}
}
@media only screen and (min-width: 20.0625em) and (max-width: 40em) {
parent child {
width: 43.75%;
margin-right: 3.125%;
margin-left: 3.125%;
}
}
/*
### Column Math ------ */
/* - [function] calc-width() (1 Assertions, 1 Passed, 0 Failed) */
/* - [function] calc-margin() (1 Assertions, 1 Passed, 0 Failed) */
/* - [function] calc-breakpoint() (3 Assertions, 3 Passed, 0 Failed) */
/* - Instance output (4 Assertions, 4 Passed, 0 Failed) */
/*
4 Tests:
- 4 Passed
- 0 Failed */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment