├── Clear Styles.sketchplugin └── README.md /Clear Styles.sketchplugin: -------------------------------------------------------------------------------- 1 | // Plugin: Clear Styles (option command /) 2 | // Source: github.com/nathco/Clear-Styles 3 | // Author: Nathan Rutzky 4 | // Update: 1.0 5 | 6 | (function() { 7 | 8 | for (var i=0; i<[selection count]; i++) { 9 | 10 | var layer = [selection objectAtIndex:i] 11 | var array = ['borders','fills','shadows','innerShadows'] 12 | var color = [[MSColor alloc] init] 13 | 14 | [color setRed:0] 15 | [color setGreen:0] 16 | [color setBlue:0] 17 | [color setAlpha:1] 18 | 19 | array.forEach(function(s) { 20 | 21 | var styles = [layer style][s]() 22 | 23 | for (var i=[styles count]; i>=0; i--) { 24 | 25 | [styles removeStylePartAtIndex:i] 26 | } 27 | 28 | [[[layer style] blur] setType:0] 29 | [[[layer style] blur] setRadius:'auto'] 30 | [[[layer style] blur] setMotionAngle:'auto'] 31 | [[[layer style] blur] setIsEnabled:0] 32 | [[[layer style] reflection] setStrength:'auto'] 33 | [[[layer style] reflection] setDistance:'auto'] 34 | [[[layer style] reflection] setIsEnabled:0] 35 | [[[layer style] contextSettings] setBlendMode:0] 36 | [[[layer style] contextSettings] setOpacity:1] 37 | }) 38 | 39 | if ([layer class] == MSTextLayer) { 40 | 41 | [layer setTextColor:color] 42 | [layer setTextBehaviour:0] 43 | [layer setLineSpacing:'auto'] 44 | [layer setTextAlignment:'auto'] 45 | [layer addAttribute:NSUnderlineStyleAttributeName value:NSUnderlineStyleNone] 46 | [layer addAttribute:NSStrikethroughStyleAttributeName value:NSUnderlineStyleNone] 47 | } 48 | 49 | else { 50 | 51 | [[[layer style] fills] addNewStylePart] 52 | } 53 | 54 | [layer setIsSelected:0] 55 | } 56 | 57 | })(); -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Clear Styles 2 | Sketch.app plugin for clearing all layer style properties. Selected layers will reset to the default style properties defined by the user. Works with text and shape layers. 3 | 4 | ## Installation 5 | 1. Download and open `Clear-Styles-master.zip` 6 | 2. Navigate the Sketch menu bar to `Plugins ▸ Reveal Plugins Folder...` 7 | 3. Place `Clear Styles.sketchplugin` into the revealed plugins directory 8 | 4. That's it... 9 | 10 | ## How to Use 11 | Select `Plugins ▸ Clear Styles` in the Sketch menu bar or use the keyboard shortcut to clear the style properties for selected layers. Please be aware that all layer styles will be deleted and reset when running the command. If you accidentally do this, you can revert the changes with the `Command` + `Z` keystroke. 12 | 13 | **Keyboard Shortcut** 14 | `Option` + `Command` + `/` 15 | 16 | ## Feedback 17 | If you discover any issues or have questions regarding usage, please send a message to [code@nath.co](mailto:code@nath.co) or find me on GitHub [@nathco](https://github.com/nathco). --------------------------------------------------------------------------------