├── .editorconfig ├── .gitignore ├── .travis.yml ├── CONTRIBUTING.md ├── Gruntfile.js ├── LICENSE ├── README.md ├── align-content.sublime-snippet ├── align-items.sublime-snippet ├── align-self.sublime-snippet ├── flex-basis.sublime-snippet ├── flex-direction.sublime-snippet ├── flex-flow.sublime-snippet ├── flex-grow.sublime-snippet ├── flex-shrink.sublime-snippet ├── flex-wrap.sublime-snippet ├── flex.sublime-snippet ├── flexbox.sublime-snippet ├── justify-content.sublime-snippet ├── order.sublime-snippet └── package.json /.editorconfig: -------------------------------------------------------------------------------- 1 | # This file is for unifying the coding style for different editors and IDEs 2 | # editorconfig.org 3 | 4 | root = true 5 | 6 | [*] 7 | charset = utf-8 8 | end_of_line = lf 9 | indent_style = tab 10 | indent_size = 4 11 | insert_final_newline = true 12 | trim_trailing_whitespace = true 13 | 14 | [*.json] 15 | indent_style = space 16 | indent_size = 2 17 | 18 | [*.sublime-snippet] 19 | indent_style = tab -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.10 4 | before_script: 5 | - npm install -g grunt-cli -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | 1. Fork it! 4 | 2. Create your feature branch: `git checkout -b my-new-feature` 5 | 3. Commit your changes: `git commit -m "Add some feature"` 6 | 4. Push to the branch: `git push origin my-new-feature` 7 | 5. Submit a pull request :) 8 | 9 | English is the universal language nowadays, so please don't create or comment on issues using another language. 10 | -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function(grunt) { 2 | grunt.initConfig({ 3 | lintspaces: { 4 | all: { 5 | src: ['**/*', '!node_modules/**/*'], 6 | options: { 7 | editorconfig: '.editorconfig' 8 | } 9 | } 10 | } 11 | }); 12 | 13 | grunt.loadNpmTasks('grunt-lintspaces'); 14 | 15 | grunt.registerTask('default', ['lintspaces']); 16 | }; 17 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Breno Polanski 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CSS Flexbox snippets for Sublime [![Build Status](https://travis-ci.org/brenopolanski/css-flexbox-sublime-snippets.svg?branch=master)](https://travis-ci.org/brenopolanski/css-flexbox-sublime-snippets) 2 | 3 | ![image snippets](https://raw.githubusercontent.com/brenopolanski/css-flexbox-sublime-snippets/assets/snippets.gif) 4 | 5 | ## Install 6 | 7 | To install through Package Control, search for [**Flexbox Snippets**](https://sublime.wbond.net/packages/Flexbox%20Snippets). If you still don't have Package Control in Sublime Text, [go get it](http://wbond.net/sublime_packages/package_control/installation). If you insist to not install it, you can download the package and put it manually inside your Pacakages directory. It should work but will not update automatically. 8 | 9 | ## Snippets 10 | 11 | Works for CSS/LESS/Sass/SCSS/Stylus & Vue Component. 12 | 13 | ## display 14 | 15 | **trigger:** flexbox⇥ 16 | 17 | ``` 18 | display: ${1:flex|inline-flex}; 19 | ``` 20 | 21 | ## flex-direction 22 | 23 | **trigger:** flexdir⇥ 24 | 25 | ``` 26 | flex-direction: ${1:row|row-reverse|column|column-reverse}; 27 | ``` 28 | 29 | ## flex-wrap 30 | 31 | **trigger:** flexwrap⇥ 32 | 33 | ``` 34 | flex-wrap: ${1:nowrap|wrap|wrap-reverse}; 35 | ``` 36 | 37 | ## flex-flow 38 | 39 | **trigger:** flexflow⇥ 40 | 41 | ``` 42 | flex-flow: ${1:<'flex-direction' (row|row-reverse|column|column-reverse)> || <'flex-wrap' (nowrap|wrap|wrap-reverse)>}; 43 | ``` 44 | 45 | ## justify-content 46 | 47 | **trigger:** flexjust⇥ 48 | 49 | ``` 50 | justify-content: ${1:flex-start|flex-end|center|space-between|space-around}; 51 | ``` 52 | 53 | ## align-items 54 | 55 | **trigger:** flexitems⇥ 56 | 57 | ``` 58 | align-items: ${1:flex-start|flex-end|center|baseline|stretch}; 59 | ``` 60 | 61 | ## align-content 62 | 63 | **trigger:** flexcont⇥ 64 | 65 | ``` 66 | align-content: ${1:flex-start|flex-end|center|space-between|space-around|stretch}; 67 | ``` 68 | 69 | ## order 70 | 71 | **trigger:** flexorder⇥ 72 | 73 | ``` 74 | order: ${1:0}; 75 | ``` 76 | 77 | ## flex-grow 78 | 79 | **trigger:** flexgrow⇥ 80 | 81 | ``` 82 | flex-grow: ${1:0}; 83 | ``` 84 | 85 | ## flex-shrink 86 | 87 | **trigger:** flexshr⇥ 88 | 89 | ``` 90 | flex-shrink: ${1:1}; 91 | ``` 92 | 93 | ## flex-basis 94 | 95 | **trigger:** flexbasis⇥ 96 | 97 | ``` 98 | flex-basis: ${1:auto|<'width' (%|rem|em|px)>}; 99 | ``` 100 | 101 | ## flex 102 | 103 | **trigger:** flex⇥ 104 | 105 | ``` 106 | flex: ${1:none|auto|[<'flex-grow' (0)> <'flex-shrink' (1)> || <'flex-basis' auto|<'width' (%|rem|em|px)>>]}; 107 | ``` 108 | 109 | ## align-self 110 | 111 | **trigger:** flexself⇥ 112 | 113 | ``` 114 | align-self: ${1:auto|flex-start|flex-end|center|baseline|stretch}; 115 | ``` 116 | 117 | ## Prefixing Flexbox 118 | 119 | Flexbox requires some vendor prefixing to support the most browsers possible. It doesn't just include prepending properties with the vendor prefix, but there are actually entirely different property and value names. This is because the Flexbox spec has changed over time, creating an ["old", "tweener", and "new"](http://css-tricks.com/old-flexbox-and-new-flexbox/) versions. 120 | 121 | Perhaps the best way to handle this is to write in the new (and final) syntax and run your CSS through [Autoprefixer](https://github.com/postcss/autoprefixer), which handles the fallbacks very well. 122 | 123 | ## Contributing 124 | 125 | If you want to help, please read the [Contributing](https://github.com/brenopolanski/css-flexbox-sublime-snippets/blob/master/CONTRIBUTING.md) guide. 126 | 127 | ## History 128 | 129 | For detailed changelog, see [Releases](https://github.com/brenopolanski/css-flexbox-sublime-snippets/releases). 130 | 131 | ## References 132 | 133 | - [Flexbox in the CSS specifications](http://www.w3.org/TR/css-flexbox/) 134 | - [A Complete Guide to Flexbox](https://css-tricks.com/snippets/css/a-guide-to-flexbox/) 135 | 136 | ## License 137 | 138 | [MIT License](https://brenopolanski.mit-license.org/) © Breno Polanski 139 | -------------------------------------------------------------------------------- /align-content.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 5 | flexcont 6 | source.css, source.scss, source.sass, source.less, source.styl, source.vue 7 | Flexbox - align-content: flex-start; 8 | 9 | -------------------------------------------------------------------------------- /align-items.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 5 | flexitems 6 | source.css, source.scss, source.sass, source.less, source.styl, source.vue 7 | Flexbox - align-items: flex-start; 8 | 9 | -------------------------------------------------------------------------------- /align-self.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 5 | flexself 6 | source.css, source.scss, source.sass, source.less, source.styl, source.vue 7 | Flexbox - align-self: auto; 8 | 9 | -------------------------------------------------------------------------------- /flex-basis.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | }; 4 | ]]> 5 | flexbasis 6 | source.css, source.scss, source.sass, source.less, source.styl, source.vue 7 | Flexbox - flex-basis: auto; 8 | 9 | -------------------------------------------------------------------------------- /flex-direction.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 5 | flexdir 6 | source.css, source.scss, source.sass, source.less, source.styl, source.vue 7 | Flexbox - flex-direction: row; 8 | 9 | -------------------------------------------------------------------------------- /flex-flow.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | || <'flex-wrap' (nowrap|wrap|wrap-reverse)>}; 4 | ]]> 5 | flexflow 6 | source.css, source.scss, source.sass, source.less, source.styl, source.vue 7 | Flexbox - flex-flow: row nowrap; 8 | 9 | -------------------------------------------------------------------------------- /flex-grow.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 5 | flexgrow 6 | source.css, source.scss, source.sass, source.less, source.styl, source.vue 7 | Flexbox - flex-grow: 0; 8 | 9 | -------------------------------------------------------------------------------- /flex-shrink.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 5 | flexshr 6 | source.css, source.scss, source.sass, source.less, source.styl, source.vue 7 | Flexbox - flex-shrink: 1; 8 | 9 | -------------------------------------------------------------------------------- /flex-wrap.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 5 | flexwrap 6 | source.css, source.scss, source.sass, source.less, source.styl, source.vue 7 | Flexbox - flex-wrap: nowrap; 8 | 9 | -------------------------------------------------------------------------------- /flex.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | <'flex-shrink' (1)> || <'flex-basis' auto|<'width' (%|rem|em|px)>>]}; 4 | ]]> 5 | flex 6 | source.css, source.scss, source.sass, source.less, source.styl, source.vue 7 | Flexbox - flex: 0 1 auto; 8 | 9 | -------------------------------------------------------------------------------- /flexbox.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 5 | flexbox 6 | source.css, source.scss, source.sass, source.less, source.styl, source.vue 7 | Flexbox - display: flex; 8 | 9 | -------------------------------------------------------------------------------- /justify-content.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 5 | flexjust 6 | source.css, source.scss, source.sass, source.less, source.styl, source.vue 7 | Flexbox - justify-content: flex-start; 8 | 9 | -------------------------------------------------------------------------------- /order.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 5 | flexorder 6 | source.css, source.scss, source.sass, source.less, source.styl, source.vue 7 | Flexbox - order: 0; 8 | 9 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "css-flexbox-sublime-snippets", 3 | "version": "0.1.0", 4 | "description": "CSS flexbox snippets for Sublime Text", 5 | "main": "Gruntfile.js", 6 | "scripts": { 7 | "test": "grunt" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/brenopolanski/css-flexbox-sublime-snippets.git" 12 | }, 13 | "keywords": [ 14 | "css", 15 | "flexbox", 16 | "sublime", 17 | "snippets" 18 | ], 19 | "author": { 20 | "name": "Breno Polanski", 21 | "email": "breno.polanski@gmail.com", 22 | "web": "http://brenopolanski.com", 23 | "twitter": "brenopolanski" 24 | }, 25 | "license": "MIT", 26 | "bugs": { 27 | "url": "https://github.com/brenopolanski/css-flexbox-sublime-snippets/issues" 28 | }, 29 | "homepage": "https://github.com/brenopolanski/css-flexbox-sublime-snippets#readme", 30 | "devDependencies": { 31 | "grunt": "^0.4.5", 32 | "grunt-cli": "^0.1.13", 33 | "grunt-lintspaces": "^0.7.1" 34 | } 35 | } 36 | --------------------------------------------------------------------------------