Skip to content

Instantly share code, notes, and snippets.

@diegonatalo
Last active June 3, 2023 13:49
Show Gist options
  • Save diegonatalo/edf32761fe759756906cf2da00f53f2e to your computer and use it in GitHub Desktop.
Save diegonatalo/edf32761fe759756906cf2da00f53f2e to your computer and use it in GitHub Desktop.
Snippets for VSCode
{
"Create react component": {
"scope": "javascriptreact,typescriptreact",
"prefix": "rc",
"body": [
"export function $1() {",
" return (",
" $2",
" )",
"}"
],
"description": "Create a basic component."
},
"Prettier plugin tailwindcss": {
"scope": "javascript",
"prefix": "pp",
"body": [
"module.exports = {",
" plugins: [",
" require('prettier-plugin-tailwindcss'),",
" require('prettier-plugin-organize-imports')",
" ]",
"}"
],
"description": "Config prettier plugins."
},
"Import HTMLAttributes": {
"scope": "typescriptreact",
"prefix": "iha",
"body": [
"import { $1HTMLAttributes } from 'react'",
"",
"interface ${TM_DIRECTORY/^.+\\\\(.*)$/$1/}Props extends $1HTMLAttributes<HTML$2Element> {",
" $3",
"}"
],
"description": "Import HTMLAttributes"
},
"Create Styled-Component": {
"scope": "javascript,typescript",
"prefix": "sc",
"body": [
"import styled from 'styled-components'",
"",
"export const $1 = styled.$2`",
" $3",
"`"
],
"description": "Create Styled-Component"
},
//CSS
"Create Global CSS": {
"scope": "css,scss",
"prefix": "global",
"body": [
"* {",
" margin: 0;",
" padding: 0;",
" box-sizing: border-box;",
"}",
"",
":focus {",
" outline: transparent;",
" box-shadow: 0 0 0 2px red;",
"}",
"",
"body {",
" background: #333;",
" -webkit-font-smoothing: antialiased;",
"}",
"",
"body, input, textarea, button {",
" font-family: 'Arial', sans-serif;",
" font-weight: 400;",
" font-size: 1rem;",
"}"
],
"description": "Create Global CSS"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment