Skip to content

Instantly share code, notes, and snippets.

@necolas
necolas / generated-ie-only.css
Last active August 29, 2015 13:56
Problem with extracting IE-specific CSS into separate stylesheet.
.a {
background: red;
}
@necolas
necolas / generated-ie.css
Last active August 29, 2015 13:56
Generating isolated IE-specific stylesheet
.a {
background: red;
/* dropped linear gradient based on IE CSS support (like what autoprefixer does) */
zoom: 1;
}
.b {
background: green;
}
@necolas
necolas / MyComponent.css
Created April 15, 2014 03:22
SUIT CSS spacing with variables
:root {
--margin-MyComponent-part: var(--theme-margin-small);
}
.MyComponent {}
.MyComponent-part {
margin: var(--margin-MyComponent-part);
}
var TweetBox = defineComponent(function() {
this.attributes({
charLimit: 140
withGeoControl: false;
});
if (withGeoControl === true) {
// attach to a sub node
this.child(GeoControl).attachTo('.GeoControl');
}
@necolas
necolas / webpack-pre-css-loader.js
Created September 8, 2014 20:15
webpack-pre-css-loader.js
var path = require('path');
/**
* CSS transform dependencies
*/
var autoprefixer = require('autoprefixer-core');
var calc = require('rework-calc');
var color = require('rework-color-function');
var conformance = require('rework-suit-conformance');
@necolas
necolas / production.css
Last active August 29, 2015 14:21
"atomic css" as compiled output
.abcd {
align-items: center;
}
.efgh {
background: blue;
}
.ijkl {
color: red;
@necolas
necolas / functions.php
Created June 17, 2010 11:23
Wordpress custom retweet and save buttons
// Adds custom retweet and delicious buttons to Wordpress template
// Uses bit.ly, delicious, backtype, tweetmeme, and topsy APIs
// Adapted from Backtype Tweetcount plugin
// Nicolas Gallagher / @necolas
function tweet_save($url) {
global $post;
$url = '';
$btype_cnt = null;
$topsy_cnt = null;
@necolas
necolas / CustomView.jsx
Last active September 15, 2015 09:12
React Web Style-API
import ReactWebStyle, {WebComponent} from 'react-web-style';
import React, {PropTypes} from 'react';
import {Text, View} from 'react-web-sdk';
const styles = {
root: {
borderColor: 'red',
padding: '10px',
position: 'absolute',
@necolas
necolas / style.css
Created April 27, 2011 12:04 — forked from chuanxshi/style.css
css descriptions
/**
* HTML5 ✰ Boilerplate
*
* style.css contains a reset, font normalization and some base styles.
*
* Credit is left where credit is due.
* Much inspiration was taken from these projects:
* - yui.yahooapis.com/2.8.1/build/base/base.css
* - camendesign.com/design/
* - praegnanz.de/weblog/htmlcssjs-kickstart
@necolas
necolas / style.css
Created June 14, 2011 12:18
HTML5 Boilerplate a la normalize.css
/* =============================================================================
HTML5 element display
========================================================================== */
article, aside, details, figcaption, figure, footer, header, hgroup, nav, section { display: block; }
audio[controls], canvas, video { display: inline-block; *display: inline; *zoom: 1; }
/* =============================================================================
Base