-
Create isolated, predictable, configurable UI components.
-
Change the way that eng-design team operates by creating a workflow and audit trail that is based on reviewing modules.
-
UI component's code and appearance are reviewed at the same time, with the same scope.
-
Automatically be aware of changes to modules that depend on the one you are changing. Encourage decomposition of UI where appropriate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Arguments are used when a function is being called. | |
We pass arguments to functions. | |
Parameters are set up when the function is defined. | |
So it is said that parameters are used to define a function and arguments are used to invoke a function. | |
These words are typically interchangeable but knowing the distinction can be handy. | |
*/ | |
var myFunction = function(x,y,z){ // x,y,z are parameters | |
return x+y+z |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! scrollin-up.js | |
* adds .su--scrollinUp to body | |
* when (and only) scrolling up | |
* http://soqr.fr/scrollin-up | |
* @author Pascal Cauhépé @eQRoeil | |
*/ | |
//do not execute if addEventListener is not supported | |
if (window.addEventListener) { | |
//from underscore.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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... | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$file = '/path/to/file.png'; | |
$filename = basename($file); | |
$upload_file = wp_upload_bits($filename, null, file_get_contents($file)); | |
if (!$upload_file['error']) { | |
$wp_filetype = wp_check_filetype($filename, null ); | |
$attachment = array( | |
'post_mime_type' => $wp_filetype['type'], | |
'post_parent' => $parent_post_id, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @subsection Get Sprites position in EM | |
* @author Marie Guillaumet | |
*/ | |
@mixin em-sprite-position($map, $sprite, $context: $fs, $offset-x: 0, $offset-y: 0) | |
{ | |
/** Thank you @pioupiouM! */ | |
$position: sprite-position($map, $sprite, $offset-x, $offset-x); | |
$x: nth($position, 1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var CSSCriticalPath = function(w, d, opts) { | |
var opt = opts || {}; | |
var css = {}; | |
var pushCSS = function(r) { | |
if(!!css[r.selectorText] === false) css[r.selectorText] = {}; | |
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/); | |
for(var i = 0; i < styles.length; i++) { | |
if(!!styles[i] === false) continue; | |
var pair = styles[i].split(": "); |
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...
- Create new instance of ImageEnhancer
- Change any
div
s within the page (which have a class ofdelayed-image-load
) into a transparent GIF using a Base64 encoded string.- We set the
width
&height
HTML attributes of the image to the required size - We know what size the image needs to be because each
div
has customdata-attr
set server-side to the size of the image - We then set a class of
image-replace
onto each newly created transparent image
- We set the
- We use a 250ms
setTimeout
to unblock the UI thread and which calls a functionresizeImages
which enhances theimage-replace
images so their source is now set to a URL whe
List of features that are supported by Opera 12 but not by Opera 15 due to the switch to Blink/Chromium:
fixed as of August 19, 2013xhr.responseType = 'json'
Link
HTTP headerLink
HTTP header for stylesheets specifically- Pressing
Enter
when an element withtabindex
has focus should trigger a click - Fragment identifiers in
data:
URIs should be handled correctly - CSS gradients with transparency
- Accurate SVG rendering
- [`` where
foo.svg
is an SVG file that contains text looks terrible](https://code.google.com/p/chromium/issues/detail?id=33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The base font size. | |
$base-font-size: 16px !default; | |
// Convert `$to` (assumed px) to em compared to a given `$context` (assumed px) | |
@function x-em($to, $context: $base-font-size) { | |
// Do not break the natural behavior of the null variables. | |
@if 'null' == type-of($to) { | |
@return $to; | |
} |