As easy as 1, 2, 3!
Updated:
- Aug, 08, 2022 update
config
docs for npm 8+ - Jul 27, 2021 add private scopes
- Jul 22, 2021 add dist tags
- Jun 20, 2021 update for
--access=public
- Sep 07, 2020 update docs for
npm version
/* | |
* Copyright (c) 2010 Tobias Schneider | |
* This script is freely distributable under the terms of the MIT license. | |
*/ | |
(function(){ | |
var UPC_SET = { | |
"3211": '0', | |
"2221": '1', | |
"2122": '2', |
@import "compass/utilities/sprites/base"; | |
// General Sprite Defaults | |
// You can override them before you import this file. | |
$emblem-sprite-base-class: ".emblem-sprite" !default; | |
$emblem-sprite-dimensions: false !default; | |
$emblem-position: 0% !default; | |
$emblem-spacing: 0 !default; | |
$emblem-repeat: no-repeat !default; |
This files contains my boilerplates for jQuery plugins.
mymodule { | |
@at-root { | |
.#{&}-header { ... } | |
.#{&}-footer { ... } | |
.#{&}-body { | |
a { ... } | |
span { ... } | |
p { ... } | |
} | |
} |
The BBC has a server-side image service which provides developers with multiple sized versions of any image they request. It works in a similar fashion to http://placehold.it/ but it also handles the image ratios returned (where as placehold.it doesn't).
The original BBC News process (and my re-working of the script) follows roughly these steps...
div
s within the page (which have a class of delayed-image-load
) into a transparent GIF using a Base64 encoded string.
width
& height
HTML attributes of the image to the required sizediv
has custom data-attr
set server-side to the size of the imageimage-replace
onto each newly created transparent imagesetTimeout
to unblock the UI thread and which calls a function resizeImages
which enhances the image-replace
images so their source is now set to a URL whe// ---- | |
// Sass (v3.3.0.rc.3) | |
// Compass (v1.0.0.alpha.18) | |
// ---- | |
$guss-rem-baseline: 10px !default; | |
// Transform a value into rem | |
// Assuming baseline is set to 10px on :root/html | |
@function rem($value, $baseline: $guss-rem-baseline) { |
module.exports = function (grunt) { | |
// Project configuration. | |
grunt.initConfig({ | |
// Store your Package file so you can reference its specific data whenever necessary | |
pkg: grunt.file.readJSON('package.json') | |
// ...tasks... | |
var gulp = require('gulp'); | |
var size = require('gulp-filesize'); | |
var stream = require('stream'); | |
var util = require('util'); | |
var styles = 'Assets/Styles'; | |
var scripts = 'Assets/Scripts'; | |
function aNewWritableStream() { | |
stream.Writable.call(this, { objectMode: true }); // make Stream behave like stream of objects instead of a Buffer with a set size |