Intro
This is a pure CSS framework. Depending on your use case you're going
to need to use your Javascript framework of choice to manipulate class
names in DOM to get the desired effects.
Installation
npm install stylecraft --save
Later in your project:
import "stylecraft/dist/stylecraft.css"
Mode
Use Javascript to add/remove
.sc-dark class to/from document body
in order to toggle between dark/light modes.
Change
Grid system
Stylecraft uses a classic grid system.
Default:
.sc-col-xs-1 to
.sc-col-xs-12 and
.sc-col-xs-offset-1 to
.sc-col-xs-offset-11
min-width: 600px:
.sc-col-sm-1 to
.sc-col-sm-12 and
.sc-col-sm-offset-1 to
.sc-col-sm-offset-11
min-width: 840px:
.sc-col-md-1 to
.sc-col-md-12 and
.sc-col-md-offset-1 to
.sc-col-md-offset-11
min-width: 1280px:
.sc-col-lg-1 to
.sc-col-lg-12 and
.sc-col-lg-offset-1 to
.sc-col-lg-offset-11
Also, adding .sc-reverse to
.sc-row reverses the direction.
Example:
12
1
11
2
10
3
9
4
8
5
7
6
6
Code:
Example:
Code:
Grid
Grid classes are prefixed with
.sc-grid- and are available from
.sc-grid-1 to
.sc-grid-12
2 columns:
Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
Item 7
Item 8
Item 9
Item 10
Item 11
Item 12
Code:
3 columns:
Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
Item 7
Item 8
Item 9
Item 10
Item 11
Item 12
Code:
6 columns:
Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
Item 7
Item 8
Item 9
Item 10
Item 11
Item 12
Code:
Flex
There are four shortcut classes to flex display:
.sc-flex-r,
.sc-flex-c,
.sc-flex-rr and
.sc-flex-cr
Row:
.sc-flex-r
Code:
Column:
.sc-flex-c
Code:
Reverse row:
.sc-flex-rr
Code:
Reverse column:
.sc-flex-cr
Code:
Form elements don't require Javascript.
Code:
Code:
Text field
Basic
Code:
With label
Code:
With icon
Code:
Textarea
Basic
Code:
With label
Code:
With icon
Code:
Code:
Code:
Three sizes are available for buttons:
.sc-sm,
.sc-md and
.sc-lg. Combine them together with
.sc-stretched and icons to get
different buttons.
Code:
Code:
Code:
Code:
Code:
Table
Add .sc-table class to table tags to
style them.
Code:
Card
You can use .sc-shadowed and
.sc-borderless classes to get
additional card variations.
Normal
Code:
Borderless
Code:
Shadowed
Code:
Slide
Use Javascript to add/remove
.sc-is-active to/from
.sc-slide in order to show/hide
slides.
Use .sc-slide-left instead of
.sc-slide-right to open slides from
the right side.
Open
Suspendisse gravida turpis sed tempor cursus. Donec nec ultrices
felis. Orci varius natoque penatibus et magnis dis parturient
montes.
Code:
Modal
Use Javascript to add/remove
.sc-is-active to/from
.sc-modal in order to show/hide
modals.
Add .sc-sm,
.sc-md,
.sc-lg,
.sc-stretched and
.sc-fullscreen classes to
.sc-modal to create different size
modals.
Open
Suspendisse gravida turpis sed tempor cursus. Donec nec ultrices
felis. Orci varius natoque penatibus et magnis dis parturient
montes.
Code:
Splash
Use Javascript to add/remove
.sc-is-active to/from
.sc-splash in order to show/hide a
splash screen.
Open
Stylecraft
A pure css framework.
2019 - 2020
Code:
Loader
Use Javascript to add/remove
.sc-is-active to/from
.sc-loader in order to show/hide a
loader screen.
Open
Loading
Please wait...
2019 - 2020
Code:
Accordion
Accordions do not require Javascript. You can create them either with
checkbox or radio inputs to draw different functionalities.
Multiple
Multiple items can be open at a time.
Code:
Single
Only one item can be open at a time. Opening a new item will
automatically collapse the previous item.
Code:
List
Just add .sc-list to a ul tag.
Code:
Highlight
Add .sc-highlight class to span or
em tags.
Highlighted text
Code:
Icon
Icons are prefixed with .sc-icon-.
One of the size classes of .sc-sm,
.sc-md or
.sc-lg should be used together with
the icon class for an icon to display properly.
You can use them together with
.sc-hover to get the hover effect.
Code:
More icons: