Skip to content

Instantly share code, notes, and snippets.

@vasilenka
Last active September 3, 2019 16:54
Show Gist options
  • Save vasilenka/60fc3821ff2376e559e4131e3adcab6e to your computer and use it in GitHub Desktop.
Save vasilenka/60fc3821ff2376e559e4131e3adcab6e to your computer and use it in GitHub Desktop.
Tinker Snippets for VS Code
{
"Stateful react component": {
"prefix": "recomp",
"body": [
"import styles from './${TM_FILENAME_BASE}.module.scss';",
"import React, { Component } from 'react';",
"import classnames from 'classnames';",
"",
"class ${TM_FILENAME_BASE} extends Component {",
"\trender() {",
"\t\treturn (",
"\t\t\t<div>",
"\t\t\t\t${0:Write your component here}",
"\t\t\t</div>",
"\t\t);",
"\t}",
"}",
"",
"export default ${TM_FILENAME_BASE};",
],
"description": "Simple react components"
},
"Stateless react component": {
"prefix": "reless",
"body": [
"import styles from './${TM_FILENAME_BASE}.module.scss';",
"import React from 'react';",
"import classnames from 'classnames';",
"",
"const ${TM_FILENAME_BASE} = ({",
"\t${1:Another props},",
"\tclassName,",
"\t...restProps",
"\t}) => {",
"\treturn (",
"\t\t<div>",
"\t\t\t${1:Write your component here}",
"\t\t</div>",
"\t);",
"}",
"",
"export default ${TM_FILENAME_BASE};",
],
"description": "Simple react stateless components"
},
"SCSS import from src/tokens": {
"prefix": "impcss",
"body": [
"@import 'src/tokens';",
"",
".root {",
"\t${0:Write your component here}",
"}"
],
"description": "Simple react scss import from src"
},
"Media queries using mixins": {
"prefix": "medq",
"body": [
"@include screen(smallPhone) {",
"\t",
"}",
"@include screen(phone) {",
"\t",
"}",
"@include screen(tablet) {",
"\t",
"}",
"@include screen(tabletLandscape) {",
"\t",
"}",
"@include screen(desktop) {",
"\t",
"}",
"@include screen(desktopWide) {",
"\t",
"}",
],
"description": "Mixins for all media queries."
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment