Skip to content

Commit

Permalink
Merge pull request #6 from topcoat/resin
Browse files Browse the repository at this point in the history
feat(Syntax): updated to the latest Resin syntax (postcss-inherit)
  • Loading branch information
GarthDB authored Sep 1, 2016
2 parents ef12ebe + c1cd208 commit 34d6ff4
Show file tree
Hide file tree
Showing 10 changed files with 209 additions and 10 deletions.
20 changes: 20 additions & 0 deletions .cz-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
'use strict';

module.exports = {

types: [
{value: 'feat', name: 'feat: A new feature'},
{value: 'fix', name: 'fix: A bug fix'},
{value: 'docs', name: 'docs: Documentation only changes'},
{value: 'style', name: 'style: Changes that do not affect the meaning of the code\n (white-space, formatting, missing semi-colons, etc)'},
{value: 'refactor', name: 'refactor: A code change that neither fixes a bug nor adds a feature'},
{value: 'perf', name: 'perf: A code change that improves performance'},
{value: 'test', name: 'test: Adding missing tests'},
{value: 'chore', name: 'chore: Changes to the build process or auxiliary tools\n and libraries such as documentation generation'},
{value: 'revert', name: 'revert: Revert to a commit'},
{value: 'WIP', name: 'WIP: Work in progress'}
],

allowBreakingChanges: ['feat', 'fix', 'perf']

};
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.DS_Store
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test
.*
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
language: node_js
node_js: "6"
after_success:
- npm run semantic-release
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Topcoat utilities
=================
# Topcoat Utilities

[![npm version](https://badge.fury.io/js/topcoat-utils.svg)](https://badge.fury.io/js/topcoat-utils)
34 changes: 31 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"name": "topcoat-utils",
"version": "0.4.0",
"description": "Utils for Topcoat",
"style": "src/utils.css",
"style": "./src/utils.css",
"scripts": {
"test": "ava test",
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
},
"repository": {
"type": "git",
"url": "https://github.com/topcoat/utils.git"
Expand All @@ -15,8 +18,33 @@
"Garth Braithwaite <[email protected]> (http://garthdb.com)"
],
"author": "Kristofer Joseph <[email protected]> (http://kristoferjoseph.com/)",
"license": "Apache2",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/topcoat/topcoat/issues"
},
"ava": {
"require": [
"babel-register"
],
"babel": "inherit"
},
"babel": {
"presets": [
"es2015"
]
},
"devDependencies": {
"ava": "^0.16.0",
"babel-cli": "^6.14.0",
"babel-core": "^6.14.0",
"babel-preset-es2015": "^6.14.0",
"babel-register": "^6.14.0",
"resin": "^1.1.0",
"semantic-release": "^4.3.5"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-customizable"
}
}
}
10 changes: 5 additions & 5 deletions src/utils.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
}

%reset-input {
extend: %reset-base;
extend: %reset-box-model;
@extend: %reset-base;
@extend: %reset-box-model;
vertical-align: top;
outline: none;
}
Expand Down Expand Up @@ -53,8 +53,8 @@
}

%reset-container {
extend: %reset-box-model;
extend: %reset-overflow;
@extend: %reset-box-model;
@extend: %reset-overflow;
word-spacing: 0;
}

Expand All @@ -66,7 +66,7 @@

%ellipsis {
text-overflow: ellipsis;
extend: %reset-overflow;
@extend: %reset-overflow;
}

%disabled {
Expand Down
79 changes: 79 additions & 0 deletions test/example.expected.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
.reset-base,
.reset-input {
padding: 0;
margin: 0;
font: inherit;
color: inherit;
background: transparent;
border: none;
}

.reset-list {
padding: 0;
margin: 0;
list-style-type: none;
}

.reset-quiet {
background: transparent;
border: 1px solid transparent;
box-shadow: none;
}

.reset-input {
vertical-align: top;
outline: none;
}

.hide-input {
position: absolute;
overflow: hidden;
padding: 0;
border: 0;
opacity: 0.001;
z-index: 1;
vertical-align: top;
outline: none;
}

.reset-cursor {
cursor: default;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}

.reset-input,
.reset-box-model,
.reset-container {
box-sizing: border-box;
background-clip: padding-box;
}

.reset-overflow,
.reset-container,
.ellipsis {
white-space: nowrap;
overflow: hidden;
}

.reset-container {
word-spacing: 0;
}

.inline-block {
position: relative;
display: inline-block;
vertical-align: top;
}

.ellipsis {
text-overflow: ellipsis;
}

.disabled {
opacity: 0.3;
cursor: default;
pointer-events: none;
}
47 changes: 47 additions & 0 deletions test/example.fixture.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
.reset-base {
@extend %reset-base;
}

.reset-list {
@extend %reset-list;
}

.reset-quiet {
@extend %reset-quiet;
}

.reset-input {
@extend: %reset-input;
}

.hide-input {
@extend %hide-input;
}

.reset-cursor {
@extend %reset-cursor;
}

.reset-box-model {
@extend %reset-box-model;
}

.reset-overflow {
@extend %reset-overflow;
}

.reset-container {
@extend %reset-container;
}

.inline-block {
@extend %inline-block;
}

.ellipsis {
@extend %ellipsis;
}

.disabled {
@extend %disabled;
}
16 changes: 16 additions & 0 deletions test/utils.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import test from 'ava';
import resin from 'resin';
import fs from 'fs';

test('compilation', t => {
const input = './example.fixture.css';
const expected = fs.readFileSync('./example.expected.css','utf-8').trim();
return resin({
src: input,
vars: true,
extend: true,
prepend: '../src/utils.css'
}).then(result => {
t.is(result.css.trim(), expected);
});
});

0 comments on commit 34d6ff4

Please sign in to comment.