Skip to content

Instantly share code, notes, and snippets.

@necolas
necolas / production.css
Last active December 29, 2024 13:09
"atomic css" as compiled output
.abcd {
align-items: center;
}
.efgh {
background: blue;
}
.ijkl {
color: red;
@necolas
necolas / Component.js
Created March 13, 2015 19:13
Leadfoot component objects example
'use strict';
/**
* Base component driver
*
* Related docs:
* https://theintern.github.io/leadfoot/Command.html
* https://theintern.github.io/leadfoot/Element.html
*
* @param {leadfoot/Command} remote
@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 / 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 / output-after-css-change.md
Created August 30, 2014 17:07
Webpack hashing and file-loader bugs

about/index.css was changed. color: black -> color: blue.

Issues with output:

  • Same hash
  • Same chunkhash (messes with cache invalidation of CSS)
  • Another different publicPath coming from file-loader in the extracted CSS.

Webpack

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 / 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);
}
@necolas
necolas / generated-ie.css
Last active December 29, 2024 13:09
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 / generated-ie-only.css
Last active August 29, 2015 13:56
Problem with extracting IE-specific CSS into separate stylesheet.
.a {
background: red;
}