Skip to content

Instantly share code, notes, and snippets.

View KittyGiraudel's full-sized avatar
🐈

Kitty Giraudel KittyGiraudel

🐈
View GitHub Profile

About Sass and Gzip

I am a little familiar with the idea behind Gzip, thanks to this great video from Frédéric Kayser (in French), however there is a something I am still not sure about.

Basically, a string gets more and more compressed every time it is being repeated. And unless I'm wrong, the longer the string, the better.

Let's talk about Sass for a second. Please consider this mixin:

@mixin center($max-width) {
@KittyGiraudel
KittyGiraudel / SassMeister-input.scss
Last active November 22, 2016 11:19
Generated by SassMeister.com.
// ----
// Sass (v3.4.9)
// Compass (v1.0.1)
// ----
@function is-number($value) {
@return type-of($value) == 'number';
}
@function is-time($value) {
@KittyGiraudel
KittyGiraudel / SassMeister-input.scss
Last active August 29, 2015 14:10
Generated by SassMeister.com.
// ----
// Sass (v3.4.7)
// Compass (v1.0.1)
// ----
// I must say I am not a big fan of having global variables here and there.
// There is a number of issues and drawbacks of handling basic configuration
// with global variables without having functional wrappers:
// - `!global` has to be written yet could be forgotten;
// - there is no way to make sure the value is valid;
@KittyGiraudel
KittyGiraudel / SassMeister-input.scss
Last active August 29, 2015 14:10
Generated by SassMeister.com.
// ----
// Sass (v3.4.7)
// Compass (v1.0.1)
// ----
/// Mixin output environment informations
/// @access public
/// @param {Bool} $absolute-path (false) - Whether or not to output paths as absolute
/// @param {String} $date-format ('%B %-d, %Y') - Date format (Ruby strftime valid)
/// @param {String} $time-format ('%H:%M') - Time format (Ruby strftime valid)
@KittyGiraudel
KittyGiraudel / SassMeister-input.scss
Last active August 29, 2015 14:10
Generated by SassMeister.com.
// ----
// Sass (v3.4.7)
// Compass (v1.0.1)
// ----
/// An equivalent of `zip` function but for maps.
/// Takes two lists, the first for keys, second for values.
/// @param {List} $keys - Keys for map
/// @param {List} $values - Values for map
/// @return {Map} Freshly created map
@KittyGiraudel
KittyGiraudel / SassMeister-input.scss
Last active August 29, 2015 14:10
Generated by SassMeister.com.
// ----
// Sass (v3.4.7)
// Compass (v1.0.1)
// ----
////
// Here is a collection of tools to help manage gradients.
// The idea is simple, you instance a gradient with the
// `gh-gradient` function in order to get a map of properties.
// This map contains a lot of things helping you tweaking your
@KittyGiraudel
KittyGiraudel / SassMeister-input.scss
Last active August 29, 2015 14:11
Generated by SassMeister.com.
// ----
// Sass (v3.4.9)
// Compass (v1.0.1)
// ----
/// Constant maps
/// Should not be dynamically updated.
/// @access private
/// @prop {List} TIME - List of `<time>` units
/// @prop {List} FREQUENCY - List of `<frequency>` units
@KittyGiraudel
KittyGiraudel / SassMeister-input.scss
Created December 18, 2014 15:35
Generated by SassMeister.com.
// ----
// Sass (v3.4.9)
// Compass (v1.0.1)
// ----
@function map-change-key-case($map, $case: 'lower-case') {
$values: 'lower-case', 'upper-case';
@if index($values, $case) == null {
@error "Argument `$case` for `map-change-key-case` must be one of: #{$values}.";
@KittyGiraudel
KittyGiraudel / SassMeister-input.scss
Last active August 29, 2015 14:12
Generated by SassMeister.com.
// ----
// Sass (v3.4.9)
// Compass (v1.0.1)
// ----
////
// Iterators in Sass, just for the heck of it.
// @access public
// @see https://github.com/HugoGiraudel/SassyIterators
// @see http://sassmeister.com/gist/d94049a3d516e31a8dad Demo
@KittyGiraudel
KittyGiraudel / SassMeister-input.scss
Last active August 29, 2015 14:12
Generated by SassMeister.com.
// ----
// Sass (v3.4.9)
// Compass (v1.0.1)
// ----
/// Map of existing generators
/// @access private
$__generators__: () !global;
/// Current generator stored in `generator`