Coder Social home page Coder Social logo

motleydev / cssketch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from johncoates/cssketch

0.0 2.0 0.0 15.3 MB

Plugin that adds CSS support to Sketch 3 for a faster design workflow.

License: MIT License

Objective-C 91.20% CSS 0.26% JavaScript 2.21% Ruby 6.33%

cssketch's Introduction

CSSketch - CSS for Sketch 3

CSSketch is a Sketch 3 plugin that enables you to modify your designs quickly by attaching it a stylesheet to it that you can use to lay out your designs, change colors and shadows quickly, etc. It supports Sass and {less} stylesheets, which means you can put functions and variables in your stylesheet to make your workflow even more efficient.

CSSketch is completely open source, so feel free to contribute to its development!

The Story Behind CSSketch

Screencast

Screencast

Download & Install

Download CSSKetch_Install.zip from the latest release.

Using CSSketch

  • To enable CSSketch you must run the menu bar option every time Sketch 3 launches. You can find it on the menu bar at Plugins -> CSSketch -> Layout Layers.
  • A stylesheet is set on a per-page basis. Set the stylesheet at Plugins -> CSSketch -> Set Page's Stylesheet for every page you want a stylesheet for. Once this is set, simply make changes to the stylesheet and save them to see the effects.
  • Take a look in Examples/ for examples of what you can do right now.
  • Please Note: Handling for many CSS rules is missing currently.

Targeting Your Sketch File

You can use the following attributes to target various components of your sketch file in combination with other css targeting methods:

  • [type="artboard"] - To target all artboards
  • [type="text"] - To target all text
  • [name="yourLayerName"] - To target all layers with yourLayerName in their name
  • .className - To target all layers named .className

Features

  • Less Support: Variables and functions are supported. Find out more at LessCSS.org
  • Auto Detect Stylesheet changes: Set the stylesheet once, and that's it. Changes are detected and applied as soon as you save the stylesheet.
  • Webkit Engine: CSSketch is powered by the WebKit engine, the same code that powers Safari and Google Chrome.
  • Toolbar Icon: A toolbar icon is added after running CSSketch for easy applying of changes.
  • Sandbox Support: CSSketch works with the Mac App Store version of Sketch 3 as well as the regular version.
  • Stylesheet Path Store In Document: You only ever have to set the stylesheet path once. It's then stored in the document for future use.

Supported CSS

  • CSSketch uses the system version of WebKit. Upgrade to El Capitan for the best compatibility with CSS standards.
  • All layout variables should work fine.
  • All elements are given default values of position:absolute, top, and left, with their current positions on the artboard.
  • For selectors: All layers are the element type "layer". The name attribute is set to a layer's name, minus the classes. The type attribute is set to "text" for text, and "artboard" for artboards.
  • Background-color is supported
  • Border is supported (only solid lines)
  • Shadow is supported
  • Color is supported
  • Text-transform is supported

Extra Resources Posted On Dribbble!

Dribbble

Community

  • Find a bug? Open an issue. Try to be as specific as possible.
  • Have a feature request Open an issue. Tell me why this feature would be useful, and why you and others would want it.

Contribute

Lot of CSS rules have yet to be added. They're decently easy to add. I appreciate all pull requests! You'll want to modify the following files to add CSS rule handling:

Changelog

  • February 2016 - 1.1: Sass support, installer, now uses SketchKit
  • October 2015 - 1.0: first release

License

MIT License

Author

Maintained and created by John Coates @punksomething

cssketch's People

Contributors

jleonard avatar johncoates avatar motleydev avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.