Skip to content

Instantly share code, notes, and snippets.

View AllThingsSmitty's full-sized avatar

Matt Smith AllThingsSmitty

View GitHub Profile
@AllThingsSmitty
AllThingsSmitty / index.htm
Last active August 29, 2015 14:14
CSS-only coffee app concept with data-driven Sass
<main>
<div class="device">
<header>
<h1><strong>CSS</strong>Presso</h1>
</header>
<section>
<form>
<input type="radio" name="coffeeType" id="espresso">
<input type="radio" name="coffeeType" id="doppio">
<input type="radio" name="coffeeType" id="macchiatto">
@AllThingsSmitty
AllThingsSmitty / resources.md
Created February 2, 2015 20:28
SassConf 2014 resource round-up
@AllThingsSmitty
AllThingsSmitty / fibonacci.js
Created February 3, 2015 14:58
Fibonacci sequence printed
// Example sequence: 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610...
// Get Fibonacci sequence with a loop
var looping = function (n) {
'use strict';
var a = 0, b = 1, f = 1;
for (var i = 2; i <= n; i++) {
f = a + b;
a = b;
b = f;
@AllThingsSmitty
AllThingsSmitty / color.scss
Last active September 24, 2015 17:25
Use Sass to dynamically change text color based on background color
@function set-notification-text-color($color) {
@if (lightness( $color ) > 50) {
@return #000; // lighter color, return black
}
@else {
@return #fff; // darker color, return white
}
}
$confirm: hsla(101, 72%, 37%, 1); // green
@AllThingsSmitty
AllThingsSmitty / fave.css
Created February 5, 2015 14:15
Twitter's "fave" animation using CSS steps()
.fave {
width: 70px;
height: 50px;
background: url(http://cssanimation.rocks/assets/images/posts/steps/twitter_fave.png) no-repeat;
background-position: 0 0;
}
.fave:hover {
background-position: -3519px 0;
transition: background 2s steps(55);
}
@AllThingsSmitty
AllThingsSmitty / brackets-setup.md
Last active August 29, 2015 14:15
A new user's guide to Brackets. Estimated reading time: <2 min. Estimated walkthrough time: 8 min.

Ready out of the Box

Brackets has a terrific built-in extension manager for super-easy add-ins. There's no setup work required, no Package Manager to install like in Sublime Text. Simply download and install Brackets and you're ready to go.

Make It Look Good

  • Install Atom Dark Theme. I like Atom's default theme.
  • Monokai Dark Soda is pretty lovely, too.
  • I prefer to increase the theme font size to 13px: ViewThemes...Theme Settings. Go with what feels best.
@AllThingsSmitty
AllThingsSmitty / global.css
Last active August 29, 2015 14:15
Sticky navigation
* {
box-sizing: border-box;
}
body {
margin: 0;
padding-top: 250px;
}
header {
padding-top: 50px;
height: 300px;
@AllThingsSmitty
AllThingsSmitty / scrollable-flexbox.css
Last active August 29, 2015 14:15
Responsive, scrollable panels with Flexbox
html,
body {
height: 100%;
line-height: 1.5;
}
.wrap {
display: box;
display: flex;
height: 100vh;
}
@AllThingsSmitty
AllThingsSmitty / accessible-menu.css
Last active October 1, 2021 14:42
Accessible dropdown menu
/* Top level nav */
.nav {
float: left;
margin: 20px 0;
}
/* Dropdowns */
.nav ul {
position: absolute;
top: 2.5em;
@AllThingsSmitty
AllThingsSmitty / effect.css
Created February 19, 2015 15:40
iOS-like transparency effect in CSS with backdrop-filter
.modal {
padding: 1rem 2rem;
max-width: 50%;
border-radius: 5px;
background-color: rgba(255, 255, 255, 0.95);
color: #333;
font-family: sans-serif;
line-height: 1.5;
}
.modal a { color: #bf0222; }