Skip to content

Instantly share code, notes, and snippets.

View IainIsCreative's full-sized avatar
🎯
Focusing

Iain IainIsCreative

🎯
Focusing
View GitHub Profile
@IainIsCreative
IainIsCreative / relative-sizing.scss
Last active August 29, 2015 14:24
A simple SCSS function to easily write out relative values. Can write in both rems and ems.
/**
*
* Relative Sizing Function
*
* Simple function for returning relative values using rems, and ems, optionally.
* Primary argument is for a target value to be converted.
* Relies on the root's font size for caclulation, set as a global variable.
*
* Secondary argument (optional) is for a context to the target value.
* Output is converted into ems.
@IainIsCreative
IainIsCreative / SassMeister-input-HTML.html
Created July 1, 2015 16:09
Generated by SassMeister.com.
<div class="container">
<blockquote>
<p>Also second their after whales called midst itself god sea and own after lights moveth. Them days. They're, created without called doesn't bring. Make all meat i above behold two saying third one, to face to own bearing their, to wherein he. Together he can't earth said. Lesser wherein herb.</p>
<cite>Anon. E. Muss</cite>
</blockquote>
</div>
@IainIsCreative
IainIsCreative / SassMeister-input-HTML.html
Created July 1, 2015 15:32
Generated by SassMeister.com.
<p class="output">
The output number is
</p>
@IainIsCreative
IainIsCreative / type-setting.scss
Last active February 8, 2023 17:07
A simple mixin for easy writing of font sizes and line heights, in rems. Also includes an option for writing type in ems.
/**
*
* SCSS Type Setting Mixin
*
* For easier writing of font sizes and line-heights, relatively.
* This can be used for writing base styles, but also specific ones if necessary.
*
**/
// Root Font Size Variable — best to avoid changing unless you like risks.
@IainIsCreative
IainIsCreative / center.css
Last active August 29, 2015 14:13
A small CSS snippet for all your demo needs.
/**
*
* CSS Centering Styles
*
* A small CSS snippet for all your demo needs.
* If you have a demo on a small bit of design (such as: http://iainspad.github.io/quotation-block/), you may want perfect centering.
* Using automatic margins and CSS transform, you can center anything!
* http://zerosixthree.se/vertical-align-anything-with-just-3-lines-of-css/ — CSS Vertical Alignment by zerosixthree.se
*
**/
@IainIsCreative
IainIsCreative / _baseline.scss
Created November 26, 2014 14:02
A very simple Baseline SCSS mixin for providing a visual baseline in your project, in CSS.
// Set up line-height and colour defaults for this mixin.
$line-height: 20px!default;
$line-color: #94d4ff!default;
/**
*
* Baseline Mixin
* Handy dandy mixin to provide a baseline for your typography.
*
* The mixin carries two arguments — the $baseline, which should match your line-height, and $baseline-color, the colour you want the lines to be.
@IainIsCreative
IainIsCreative / type-setting.scss
Last active April 15, 2023 18:26
A simple setup using a function and a SCSS mixin to set up type size and line heights over an element. (Deprecated)
/**
*
* SCSS Type Setting Mixin
*
* For easier writing of font sizes and leading, relatively.
* This can be used for writing base styles, but also more specific ones if necessary.
*
**/
$base-font-size: 16px; //Set up base font size, 16px by default.