Skip to content

Instantly share code, notes, and snippets.

@olygood
Last active August 19, 2022 13:28
Show Gist options
  • Save olygood/5e59994903fd1478f47409b2fc91db4e to your computer and use it in GitHub Desktop.
Save olygood/5e59994903fd1478f47409b2fc91db4e to your computer and use it in GitHub Desktop.
snippets html/ css/ javascript
{
"Absolute-Center":{
"prefix": "absolute-center",
"body":[
"position:absolute;\rtop:50%;\rleft:50%;\rtransform:translate(-50%,-50%);"
],
"description": "center an absolute position element."
},
"flex-Center":{
"prefix": "flex-center",
"body":[
"display: flex;\rflex-direction: row;\rjustify-content: center;\ralign-items: center;"
]
},
"Reset-Css":{
"prefix": "css-reset",
"body":[
"*{\rmargin: 0;\rpadding: 0;\rbox-sizing: border-box;\r}\r$1"
]
},
"Border-css":{
"prefix": "border:2px solid black ?",
"body":[
"border: 2px solid black;$1"
]
}
}
{
"Html":{
"prefix": "html",
"body": [
"<!DOCTYPE html\r<html lang="en">\r<head>\r<meta charset="UTF-8">\r<meta http-equiv="X-UA-Compatible" content="IE=edge">\r<meta name="viewport" content="width=µ, initial-scale=1.0">\r<title>Document</title>\r</head>\r<body>\r</body>\r/html>>"
]
}
}
{
"Query Selector":{
"prefix":"querySelector",
"body":[
"const $1 = document.querySelector$2('$3');$4"
],
"description": "sectionner élément du doom avec querySelector"
},
"For Loop":{
"prefix":"forLoop",
"body":[
"for(let $el = 0; $el< $1; $el++){\r\r};$2"
]
},
"Function":{
"prefix":"func",
"body":[
"const $1 = ($2)=>{$3};$4"
]
},
"Console Log":{
"prefix":"cl",
"body":[
"console.log($1);$2"
]
},
"Objet":{
"prefix":"obj",
"body":[
"const $1 = {\r $2:'$3',$4\r};$5"
]
},
"Class":{
"prefix":"clas",
"body":[
"const $1 = class {\rconstructor($2,$3) {\rthis.$4 = $5;$6\r\r};"
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment