Skip to content

Instantly share code, notes, and snippets.

View jayperryworks's full-sized avatar

Jay Perry jayperryworks

View GitHub Profile
@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": {
@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 / .nvmrc
Created January 26, 2021 17:53
Fetch API data with node.js
14.15.3
@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 / 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 / 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: " ";
# 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 / .gitattributes
Created January 20, 2016 00:06
Git LFS setup for design files
# 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

Bivee CSS Framework

CSS is quite possibly the best visual design tool ever invented. Its ability to control an interface’s layout, type, color, and behavior “unobtrusively” — changing the way the interface is presented without disturbing the content — is, as far as I know, unparalleled in this industry or any other. CSS is the best tool for executing website design, but it is quickly finding broader uses (native apps, vector graphics, electronic books, and even print design, among others). It uses a syntax so simple you can learn its basics in a few days, but you can spend a lifetime exploring its nuances. Much of its power comes from the way it teaches you to think about how interface and content work together. A few months’ writing CSS and you’ll find yourself seeing your work in a different way.

The language, however, is in an interesting place these days. The web — and interactive design in general — has come a long way from where it started in the early 1990s. Where web pages were originally seen as

@jayperryworks
jayperryworks / _icon.erb
Last active August 29, 2015 14:11
A simple ERB partial (for Middleman) to insert an external icon sprite. Based on the svg4everybody guidelines (https://github.com/jonathantneal/svg4everybody).
<%# A simple partial for inserting SVG sprites. %>
<%# @param id: (string) the ID of the sprite you want %>
<%# @param classes: (string, optional) any classes you'd like to add. %>
<%# @param role: ARIA role. use either 'img' (default) or 'presentation'. %>
<%# -> "presentation" designates it as simply decoration (and should be ignored by screenreaders) %>
<%# -> while "img" says it should have its own description. In the latter case, the title attribute acts like an alt tag. %>
<% classes ||= "" %>
<% title ||= "" %>
<% role ||= "img" %>