Skip to content

Instantly share code, notes, and snippets.

@cahnory
cahnory / StyledComponent.jsx
Last active August 29, 2015 14:21
What I want to style react components
// This code does not work!
// It's just a thought about a way of adding style to a react component
React.createClass({
render: function () {
return (
<div ref="module">
<div ref="title">{ props.user.title }</div>
<div ref="description">{ props.user.description }</div>
</div>
);
@cahnory
cahnory / SassMeister-input.scss
Created June 9, 2015 09:10
Generated by SassMeister.com.
// ----
// Sass (v3.4.14)
// Compass (v1.0.3)
// ----
// content for all query modifiers map (name: query)
@mixin vary-query($queries, $none: true) {
$prev: $VARY__OPENED;
// No query modifier
@cahnory
cahnory / SassMeister-input.scss
Created June 9, 2015 13:11
Generated by SassMeister.com.
// ----
// Sass (v3.4.14)
// Compass (v1.0.3)
// ----
@mixin rgback($color, $alpha: 1, $rest...) {
@if 'color' != type-of($color) or 1 == alpha($color) {
$color: rgba($color, $alpha, $rest...);
}
@cahnory
cahnory / SassMeister-input.scss
Created July 21, 2015 09:53
Generated by SassMeister.com.
// ----
// Sass (v3.4.14)
// Compass (v1.0.3)
// ----
// ASSERT ------------------------------------------------------
/// Call multiple asserts at once
/// @param {*} $value
/// @param {List} $asserts
@cahnory
cahnory / SassMeister-input.scss
Created August 25, 2015 13:17
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
@function foo($arg1, $arg2) {
@return type-of($arg1), type-of($arg2);
}
foo {
foo: call('foo', (arg1, arg2)...);
@cahnory
cahnory / SassMeister-input.scss
Created September 11, 2015 09:19
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
@mixin hold-once($name) {
// if placeholder not in declared ones
@if not index($PLACEHOLDER__DECLARED, $name) {
// set placeholder as declared
$PLACEHOLDER__DECLARED: append($PLACEHOLDER__DECLARED, $name)!global;
@cahnory
cahnory / SassMeister-input-HTML.html
Created September 14, 2015 15:03
Generated by SassMeister.com.
<div class="arrow">
dsdasa
</div>
@cahnory
cahnory / assert-demo.scss
Created September 28, 2015 07:37
Assert in sass
// Assert example
// https://bitbucket.org/cahnory/integrate-css/src/c9c8df11cddf/libs/assert/
$color: assert($color, (type: 'color', default: #333));
$font-size: assert($font-size, (type: 'number', default: 14));
$line-height: assert($line-height, (type: 'number', default: 1.35));
$font-family: assert($font-family, (default: (Arial, sans-serif)));
$age: assert($age, (type: 'number', gte: 18));
@cahnory
cahnory / dabblet.css
Created January 2, 2012 22:33
Embed buttons
/**
* Embed buttons
*/
body {
background: #3a3f48;
}
.button {
background: linear-gradient(#525866, #292C33);
border: none;
border-radius: 4px;
@cahnory
cahnory / dabblet.css
Created January 25, 2012 19:07
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
.button {
background: #EEE;
border: 1px solid #DDD;
border-bottom: 2px solid #BBB;
border-radius: 2px;
background: linear-gradient(90deg, #DDD, #EEE);
box-shadow: inset 0 1px #F8F8F8, inset 0 0 0 1px rgba(255,255,255,.2),0 2px 2px -1px rgba(0,0,0,.6);