Skip to content

Instantly share code, notes, and snippets.

View jayperryworks's full-sized avatar

Jay Perry jayperryworks

View GitHub Profile
# output files
*.jpg filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
# raw files
*.CR2 filter=lfs diff=lfs merge=lfs -text
# work files
*.sketch filter=lfs diff=lfs merge=lfs -text
@jayperryworks
jayperryworks / aspect_ratio.scss
Created March 30, 2016 19:45
Create a thumbnail image (or whatever) that is constrained to a particular aspect ratio.
// padding to force an aspect ratio
// -> apply mixin to a container element, and the child element will be constrained
// -> mostly used for images, but should work on basically anything
@mixin media-aspect($w, $h, $child_el: ".media-aspect-content") {
position: relative;
overflow: hidden;
&::before, &:before {
display: block;
content: " ";
@jayperryworks
jayperryworks / aspect.scss
Created June 14, 2016 01:24
Sass mixin to force a fluid container to preserve a certain aspect ratio
// padding to force an aspect ratio
// -> apply mixin to a container element, and the child element will be constrained
// -> mostly used for images, but should work on basically anything
@mixin media-aspect($w, $h, $child_el: ".media-aspect-content") {
position: relative;
overflow: hidden;
&::before, &:before {
display: block;
content: " ";
@jayperryworks
jayperryworks / component-defaults.scss
Last active May 1, 2019 03:36
Exploring web components: a 'gallery' custom element that uses Shadow DOM to display a grid of list elements.
// Default styles for components
// -> so they're still usable if JS fails or they're not supported
jpw-gallery:not(:defined) {
display: block;
list-style: none;
}
@jayperryworks
jayperryworks / .nvmrc
Created January 26, 2021 17:53
Fetch API data with node.js
14.15.3
@jayperryworks
jayperryworks / .stylelintrc.json
Created March 2, 2021 19:13
StyleLint config for SCSS files (using my naming conventions)
{
"extends": "stylelint-config-sass-guidelines",
"plugins": [
"stylelint-scss",
"stylelint-order"
],
"rules": {
"indentation": "tab",
"selector-no-qualifying-type": [
true,
@jayperryworks
jayperryworks / .eslintrc
Created March 2, 2021 19:14
ESLint config with standard syntax, tabs, & my preferences
{
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": [
"standard"
],
"globals": {