Karamel
A work in progress CSS framework
Usage
npm install karamel
@import 'karamel'
Parts
Font Size
Control the font size of any element using a range between 1
and 10
.
Font Color
Font Style
Font styles allow you to apply several styles at once to maintain consistancy within your typography without being too restrictive. Combine with font size
to maintain varied visuals without creating inconsistancies.
font-text
font-heading
font-link
font-code
font-quote
Letter Spacing
Set the spacing between letters.
Line Height
Set the line height of text.
Background
Color Theme
Color schemes are useful when a design alternates between blocks of colour because often when a background colour changes other colours much change to accomodate that color.
color
Applies the default colour themecolor-reverse
Reverses the background and text colours of the default color themecolor-constrast
Applies a contrasting color theme based on the default color theme.color-<name>
Create your own color themes
Flex
The easiest way to apply layout using the following parts.
flex
Applies default flex layout behaviourflex-block
Makes all child elements behave like block elements and wraps themflex-inline
Males all child elements behave like inline elements and wraps themflex-column
Changes direction of layoutflex-wrap
To change the default flex behaviour pass an option through the plugin flex({default: 'flex-block'})
.
Width
Specify width of an element.
w-<integer:1-20>
w-<unit>
w-content
Sets to width of contentw-flex
Sets width to available spacew-viewport
Forces to width of viewport
Height
Specify height of an element.
Margin
Specify margin on an element.
m<side>?-<integer:1-20>#{1,4}
m<side>?-<unit>#{1,4}
Padding
Specify padding on an element.
p<side>?-<integer:1-20>#{1,4}
p<side>?-<unit>#{1,4}
The padding property allows you to use negative values when you want to apply the same negative margin as padding. Useful when you need to compensate for a parent that has padding or margins or to increase the hit area of a link.
Border
Specify a border on an element
b<side>?-[<width>|<style>|<color>|<align>]#{1,3}
b-<color>
b-<width>
Configure
{
color: {
theme: {
default: {
text: '',
heading: '',
link: '',
border: '',
background: ''
},
contrast: {},
reverse: {}
}
},
font: {
family: {
arial: {}
},
style: {
text: {
'font family': '',
'line height': '',
'letter spacing': '',
'font weight': ''
},
heading: {},
link: {},
code: {},
quote: {}
}
}
}