Skip to content

Instantly share code, notes, and snippets.

View 0xemc's full-sized avatar

Michael Collins 0xemc

  • xemc
  • Australia
  • 19:21 (UTC +10:00)
View GitHub Profile
@0xemc
0xemc / fluid-type.scss
Last active November 30, 2022 03:58
Fluid Typography Mixin (SCSS)
// This mixin can be used to provide Fluid Type behaviour accross your entire web page
// or to a single css selector
//
// Full credit goes to Geoff Graham @ https://css-tricks.com/snippets/css/fluid-typography/
//
// To apply globally:
//
// 1. Define your minimum and maximum screen widths
// 2. Define your min and max font size for H1 element in px
// 3. Apply fluid-type mixin to root element eg.
@0xemc
0xemc / breakOn
Created May 10, 2018 14:04
breakOn
function breakOn(obj, propertyName, mode, func) {
// this is directly from https://github.com/paulmillr/es6-shim
function getPropertyDescriptor(obj, name) {
var property = Object.getOwnPropertyDescriptor(obj, name);
var proto = Object.getPrototypeOf(obj);
while (property === undefined && proto !== null) {
property = Object.getOwnPropertyDescriptor(proto, name);
proto = Object.getPrototypeOf(proto);
}
return property;