Skip to content

Instantly share code, notes, and snippets.

// Add a prefix to a string of classNames.
// Example: prefixClasses("text-red-500 bg-blue-500", "hover") => ["hover:text-red-500", "hover:bg-blue-500"]
export function prefixClasses(classes: string, prefix: string): string[] {
const classNames = classes.split(" ");
return classNames.map((className) => `${prefix}:${className}`);
}
// Add "dark:" to a string of classNames.
// Example: darkClasses("text-red-500 bg-blue-500") => ["dark:text-red-500", "dark:bg-blue-500"]
export function darkClasses(classes: string): string[] {
@Jonnotie
Jonnotie / SketchSystems.spec
Created November 6, 2020 02:26
My Awesome Sketch
My Awesome Sketch
First State
Some event -> Second State
Second State
Verifying that +jonnotie is my openname (Bitcoin username). https://onename.io/jonnotie
@Jonnotie
Jonnotie / calc.sass
Created May 16, 2013 11:58
calc() mixin
=calc($property, $expression)
#{$property}: -moz-calc(#{$expression})
#{$property}: -o-calc(#{$expression})
#{$property}: -webkit-calc(#{$expression})
#{$property}: calc(#{$expression})
# Install kicker on osx: sudo gem install kicker --source http://gemcutter.org
#
# Place a `.kick' file with this code in the root of your project, which contains the file to watch.
# Then start running kicker from the project root: $ kicker
module Mockup
FILE_TO_WATCH = 'mockup.psd'
FOLDER = 'output'
def self.last_exported_version
# Install kicker on osx: sudo gem install kicker --source http://gemcutter.org\
#
# Place a `.kick' file with this code in the root of your project, which contains the file to watch.
# Then start running kicker from the project root: $ kicker
FILE_TO_WATCH = 'mockup-1.psd'
counter = nil
if File.exist?('output')
# Install kicker on osx: sudo gem install kicker --source http://gemcutter.org\
#
# Place a `.kick' file with this code in the root of your project, which contains the file to watch.
# Then start running kicker from the project root: $ kicker
FILE_TO_WATCH = 'mockup-1.psd'
counter = nil
if File.exist?('output')