All Projects → jodyheavener → Css Buddy

jodyheavener / Css Buddy

A Sketch 3 plugin that allows you to use CSS on layers.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Css Buddy

Sketch Gifme Plugin
Embed gifs and videos in your Sketch files!
Stars: ✭ 274 (-1.79%)
Mutual labels:  sketch-plugin, sketch
Sketch Connection Flow Arrows
Plugin for generating easy to use connection flow arrows in Sketch
Stars: ✭ 275 (-1.43%)
Mutual labels:  sketch-plugin, sketch
autopdfexporter-sketch-plugin
A Sketch Plugin to auto-export all '[S]' Prefix artboards to a single pdf, no slices needed! Plugin auto creates slices from prefixed Artboards and exports them into a single page-sorted pdf file.
Stars: ✭ 16 (-94.27%)
Mutual labels:  sketch, sketch-plugin
Sketch-Plugin
Plugin to share artboards directly via WeTransfer. Share the link easily with your colleagues and friends.
Stars: ✭ 39 (-86.02%)
Mutual labels:  sketch, sketch-plugin
sketch-search-everywhere
A Sketch plugin for searching layer and selecting it.
Stars: ✭ 53 (-81%)
Mutual labels:  sketch, sketch-plugin
sketch-dark-mode
Generate a dark mode version of any Sketch document, the right way.
Stars: ✭ 58 (-79.21%)
Mutual labels:  sketch, sketch-plugin
sketch-plugin
Design your next Atlassian app with our component libraries and suite of Sketch tools 💎
Stars: ✭ 51 (-81.72%)
Mutual labels:  sketch, sketch-plugin
Isometry
📦 Sketch plugin that allows to create isometric projections from layers
Stars: ✭ 18 (-93.55%)
Mutual labels:  sketch, sketch-plugin
instance-locator
Sketch plugin to locate instances of a symbol
Stars: ✭ 34 (-87.81%)
Mutual labels:  sketch, sketch-plugin
nudge-resize-sketch-plugin
Sketch Plugin to quickly resize a layer with keyboard shortcuts
Stars: ✭ 25 (-91.04%)
Mutual labels:  sketch, sketch-plugin
Sketchcontentsync
Sync sketch files with google docs.
Stars: ✭ 270 (-3.23%)
Mutual labels:  sketch-plugin, sketch
Sketch-StickyGrid
Sketch plugin to make paths be snapped to grid.
Stars: ✭ 62 (-77.78%)
Mutual labels:  sketch, sketch-plugin
sketch-library-audit
Export Symbol and Shared Style data from any Sketch Library to CSV.
Stars: ✭ 17 (-93.91%)
Mutual labels:  sketch, sketch-plugin
sketch-find-and-replace-text
Find and replace text throughout your Sketch document
Stars: ✭ 41 (-85.3%)
Mutual labels:  sketch, sketch-plugin
Assistant
Talk to Sketch
Stars: ✭ 35 (-87.46%)
Mutual labels:  sketch, sketch-plugin
Chromata
A color plugin for Sketch
Stars: ✭ 15 (-94.62%)
Mutual labels:  sketch, sketch-plugin
sketch-library-unlinker
A Sketch plugin that can unlink symbols linked to a specific library, or unlink symbols that have been deleted in their libraries.
Stars: ✭ 21 (-92.47%)
Mutual labels:  sketch, sketch-plugin
sketch-slicer
Creating slices for selected layers in Sketch
Stars: ✭ 37 (-86.74%)
Mutual labels:  sketch, sketch-plugin
sketch-markup-listify
Sketch plugin for convert and copy text layers into HTML lists.
Stars: ✭ 31 (-88.89%)
Mutual labels:  sketch, sketch-plugin
Sketch Module Web View
A sketch module for creating an complex UI with a webview
Stars: ✭ 270 (-3.23%)
Mutual labels:  sketch-plugin, sketch

CSS Buddy

A Sketch 3 plugin that allows you to use CSS on layers.

v0.0.3

Note: this plugin is still in early stages of development.

Click riiiight here to see a demo (the gif bogged down this page).

Usage

Once you install the plugin just select a layer on your canvas and run Apply to Selected or press Command + Shift + A. A text dialogue will prompt you to enter in CSS.

  • Only use available and valid CSS properties – available properties listed below

    Do this:

    background-color: blue;
    opacity: 0.5;
    box-shadow: 0 10px 20px rgba(0,0,0,.13), 0 4px 7px rgba(0,0,0,.2);
    
  • Enter them as if you are already inside your selector

    Don't do this:

    .my-layer {
      background: blue;
      opacity: 0.5;
      box-shadow: 0 10px 20px rgba(0,0,0,.13),0 4px 7px rgba(0,0,0,.2);
    }
    
  • Supported layer types are: Shape, Text, and Artboard.

  • If any styles fail to apply or are unsupported a dialogue box will (err, should) alert you to the failed attempts afterward.

Overwriting

The "Apply to Selected" dialogue has a checkbox labelled "Overwrite Fills, Borders, and Shadows?". Check this to remove all of a property's existing styles before applying new ones.

Multiple values

Fills, borders, and shadows can all accept comma-separated multiple values. This can come in handy when wanting to quickly apply multiple styles (background: red, blue, green;). Technically all other styles will also accept multiple values, but the last of each set of values will overwrite the others. These rules also apply when declaring the property multiple times.

Units

All values for size/length/amount are to be in pixel (px) unit, unless using 0, initial, or none (where applicable). Using ems wouldn't work because we have no context/parent value. Support for other units will be added if it's logical and in high demand.

Note: Sketch does not allow setting layer dimensions to 0, so 0 is disabled for width and height properties.

Colors

Acceptable color formats are Hexadecimal (#FF7F50), RGB (rgb(255, 127, 80)), RGBa (rgba(255, 127, 80, 1)), and generic color names (coral). Support for HSL format will be added eventually.

CSS properties

The following is a list of supported CSS properties that can be applied to a given layer in Sketch:

Note: for the most part only shorthand properties work. Support for longhand properties will be added eventually.

Shape

  • width
  • height
  • opacity
  • box-shadow
  • border-radius
  • background | background-color (fills only)
  • border | border-width/color when only one border exists

Text

  • opacity
  • text-shadow
  • line-height
  • color
  • letter-spacing
  • text-transform
  • line-height

Artboard

  • width
  • height
  • background | background-color (fills only)

Going forward

Writing a CSS parser is hard, and for that reason I completely acknowledge that this tool is going to have a multitude of bugs and will never be as flexible as true web CSS. I encourage anyone who is interested to contribute to this project.

Here is a small list of what I hope/plan to build in to the tool in the future...

  • [Started] Obviously, expand on the basic features, like more CSS properties and their accepted values

  • Specifically, I'd like to see support for applying gradients and background images

  • Implement custom properties and values for styles that are not currently supported by CSS (lookin' at you, Zoom Blur and Blend Mode).

  • Find a way to associate layers with class names so that when you change a class' ruleset it gets applied to all layers with that class

  • [Started] Create layers using CSS, using the selector as the layer name (and possibly some custom properties), like:

    rectangle[name="My Rectangle"] {
      background: red;
      width: 100px;
      height: 150px;
    }
    
    text[name="My Text"] {
      content: "This is some text!"
      font-size: 20px;
    }
    

Changelog

  • v0.0.3 - January 31st 2015
    • Added support for Artboard and Text Layers, and more property values for the respective layer types
    • Added keyboard shortcuts to apply styles and create layers
    • Updated branding
  • v0.0.2 - January 15th 2015
    • Rewritten code-base
    • Increased flexibility when adding new property values
    • Started "Create Layer" feature - putting on hold for now
  • v0.0.1 - January 13th 2015
    • Initial release - Shapes only

Known Issues ¯\(ツ)

  • Text layers don't always refresh when a style is applied.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].