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 / 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 / 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
@necolas
necolas / intern.config.js
Created September 8, 2014 20:58
Auto-generating the intern test config
/**
* Functional and Unit test configuration
*
* This configuration file has to work in both Node.js and browser environments.
* Therefore, this config is a template that is used to build the Intern config
* used to run the tests. The packages and suites are automatically defined.
*
* Learn more about configuring Intern at:
* https://github.com/theintern/intern/wiki/Configuring-Intern
*/
@necolas
necolas / Button.jsx
Last active November 4, 2015 00:05
CSS-in-JS to CSS
import React from 'react';
import styles from './styles.css.js';
class Button extends React.Component{
render() {
return (
<button className={styles.button}>
<span className={styles.icon} />
Button
</button>