Skip to content

Instantly share code, notes, and snippets.

View Camwyn's full-sized avatar
🐫
yup

Stephen Page Camwyn

🐫
yup
View GitHub Profile
module.exports = {
main: ['release/<%= pkg.version %>'],
clean: ['assets/svg/min/*.svg']
};
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Camwyn
Camwyn / SassMeister-input.scss
Last active November 16, 2016 19:00
Mixin that allows you to pass @content to one or all of the typical selector modifiers - :active, :hover, :focus. Generated by SassMeister.com.
// ----
// libsass (v3.3.6)
// ----
///
/// Add styles on active/focus/hover
///
/// @group Functions
///
/// @content Really more of a parameter as the mixin will output an empty rule if none is provided.
@Camwyn
Camwyn / visually-hidden.css
Last active November 16, 2016 18:49
Visually-hidden mixin. Uses selector-nest to allow showing on focus/active. Generated by SassMeister.com.
.example:not(:focus):not(:active) {
clip: rect(1px, 1px, 1px, 1px);
height: 1px;
overflow: hidden;
position: absolute;
white-space: nowrap;
width: 1px;
}
.example2 {
@Camwyn
Camwyn / Stick stacking
Created November 11, 2016 15:31
"Stacked" items using scroll-to-fixed
/**
* Sticky / scroll-to-fixed elements
*/
( function( window, $ ) {
'use strict';
// This array contains all the elements we want to "stick" You can add
// another in, but the order matters! Each gets margin-top that includes
// the height of the previous items.
@Camwyn
Camwyn / opacity.scss
Last active November 2, 2016 16:25
Opacity mixins with fallback color
/**
* Translucent background colors with opaque text!
*
* @example scss
* @include background-opacity(#000, .5)
*
* @param {String} $color hexadecimal color
* @param {Integer} $opacity opacity value 0-1
*/
@mixin background-opacity( $color, $opacity: .5 ) {
@Camwyn
Camwyn / placeholder.scss
Last active November 3, 2016 14:57
Placeholder State
/**
* @alias placeholder-state
* Styling placeholder text color states ( default, hover, focus )
* USE: @include placholder( #999, #999, #222 );
*/
@mixin placeholder-state( $default: inherit, $hover: $default, $focus: $default ) {
// You have to declare the -moz/-webkit separately in order for them to work
&::-webkit-input-placeholder {
color: $default;
}
@Camwyn
Camwyn / line-clamp.scss
Created November 2, 2016 16:04
CSS Line Clamp
/**
* CSS Line Clamp
*
* @example scss
* @include line-clamp(2, 16, 1.5)
*
* @param {Integer} $lines: number of lines to show
* @param {Integer} $font-size: font size in px (no trailing 'px'!)
* @param {Integer} $line-height: line height (multiplier/unitless)
*/
@Camwyn
Camwyn / theming.scss
Created November 2, 2016 15:59
Theming colors mixin
/**
* Primary colors per locations
*
* $property: the CSS property you're setting
* $value: the value of the property. Optional.
* $selector: add a selector to help targeting. Optional.
* $opacity: use a transparent/translucent color. Optional.
* Example: @include location-color( 'border-top', 3px, '> a:hover:after', .8 );
*/
$locations: (
@Camwyn
Camwyn / triangle.scss
Created November 2, 2016 14:59
CSS triangle indicator arrows
/**
* Create css triangle indicators
*
* $direction: the direction to point TO
* $size: desired size of the borders (always creates an equilateral triangle)
* $color: desired color of triangle
* example: @include indicator-arrow(left, $color: '#000');
*/
@mixin indicator-arrow($direction: top, $size: .75rem, $color: #ffffff) {
border: $size solid transparent;