Skip to content

Instantly share code, notes, and snippets.

View alexiscordova's full-sized avatar

Alexis Córdova alexiscordova

View GitHub Profile
@alexiscordova
alexiscordova / nth-child-mixins.scss
Created July 6, 2016 17:43
Sass mixins to make CSS nth-child selectors easier to work with
// Select the first nth elements
@mixin first($number) {
@if $number == 1 {
&:first-child {
@content;
}
}
@else {
&:nth-child(-n + ${$number}) {
@content;
@alexiscordova
alexiscordova / sass-mq-mixin.scss
Last active June 12, 2017 15:17
A Sass mixin that creates media query declarations based on $map keys and values
// Media Query Breakpoints – Breakpoint values should be in ems, which will allow triggering when users zoom.
// Per the W3C, relative units in media query declarations are based on the initial value of :root, which is 16px
// e.g., font-size: 1em = 1rem = 16px = 100%;
// http://www.w3.org/TR/css3-mediaqueries/#units
// TODO: look into x-small and small values for 4-inch mobile devices
$screen-sm: 0; // 0px
$screen-md: 40em; // 640px
$screen-lg: 64em; // 1024px
$breakpoints: (
@alexiscordova
alexiscordova / triangle-mixin.scss
Last active June 12, 2017 15:33
Sass mixin to create CSS triangles
@mixin triangle($direction, $size: 0.375rem, $color: #222){
display: block;
position: absolute;
width: 0;
height: 0;
content: '';
@if ($direction == 'up'){
border-right: $size solid transparent;
border-bottom: $size solid $color;
border-left: $size solid transparent;
// Copyright (c) 2017-present, salesforce.com, inc. All rights reserved
// Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license
"use strict"
module.exports = {
"plugins": [
"stylelint-scss",
],
"ignoreFiles": [