Skip to content

Core variables, mixins and functions for the silc framework

License

Notifications You must be signed in to change notification settings

nickrigby/silc-core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

silc core Build Status npm version

The core module contains a number of SASS variables/mixins/functions, and a JavaScript class for the silc framework.

SASS functions

em

Converts a pixel value into its em equivalent. Accepts a second "context" parameter, which is the context value to base the calculation on. The context parameter defaults to the value of @silc-core--font-size, which by default is 16px.

em(16); // Returns 1em
em(16, 32); // Return 2em

rem

Converts a pixel value into its rem equivalent. The context for rem calculations is the root (html) element font size, which defaults to the value of @silc-core--font-size.

rem(25); // Returns 1.5rem

strip-unit

Strips units from a passed in string.

strip-unit(16px); // Returns 16

SASS mixins

media

Creates a media query based on a passed in breakpoint name, defined in $silc-core--breakpoints.

@include media('large') {
    font-size: rem(20);
}

SASS variables

A number of SASS variables are available to override. One particular variable to pay attention to is the $silc-core--breakpoints variable. The breakpoints variable allows you to create your own named breakpoints, which will then be used when using other silc modules like silc-grid.

JavaScript class

The SilcCore class adds a js class to the body element, which can then be used to progressively enhance your styles.

About

Core variables, mixins and functions for the silc framework

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published