Lorem ipsum dolor
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod temporinvidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
Learn MoreSpryCSS aims to be a simple and customizable CSS Toolkit while being as lightweight as possible (Only 13kb gzipped).
The goal is to remove the messy and tedious task of coming up with class names for elements that just need simple layout styles and provide basic components to help you get up and running fast, but not try to do everything which can bloat your project. If an element needs more then just the basic utility styles then that element most likely should have a custom class name and custom styles in your CSS files.
SpryCSS does not use !important
.
So if a SpryCSS class is not working then chances are you have already set that style in a css file
and therefore you should update the style there instead of overriding it in the html.
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/ggedde/spry-css@2.3.23/dist/spry.min.css">
JS Only needed for Sliders
<script defer src="https://cdn.jsdelivr.net/gh/ggedde/spry-css@2.3.23/dist/spry-slider.min.js"></script>
npm install @ggedde/spry-css
Then in your scss file import SpryCSS:
@import 'node_modules/@ggedde/spry-css/spry.scss';
Note: you may need to change the path to match your project's node_modules folder
yarn add @ggedde/spry-css
Then in your scss file import SpryCSS:
@import 'node_modules/@ggedde/spry-css/spry.scss';
Note: you may need to change the path to match your project's node_modules folder
To override the Spry Variables just declare the variables before you import the file.
@import 'your_variables.scss';
@import 'node_modules/@ggedde/spry-css/spry.scss';
// Specify each breakpoint size
$breakpoints: (
md: 40em,
lg: 80em,
);
// Specify each breakpoint gap size. <section> tags with get padding based on gap size.
// You must include one for each Breakpoint otherwise it will result in a Compile Error.
$gaps: (
default: 1.25em,
md: 2em,
lg: 2.25em,
);
// Specify each color used in color-, bg-, border-, btn-
$colors: (
"white": #ffffff,
"light": #efefef,
"medium": #888888,
"dark": #444444,
"primary": #1494df,
"warning": #df8a22,
"error": #d52929,
"success": #09c347,
"text": #566067,
"transparent": transparent,
);
// Specify each type tag and class like <h3> and .h3 etc.
$types: (
body: ( font-family: Helvetica, font-size: clamp(.9em, 3vw, 1.0em), font-weight: 300, color: map-get($colors, 'text'), line-height: 1.4 ),
h1: ( font-size: 3.4em, font-weight: 400, line-height: 1.20 ),
h2: ( font-size: 2.7em, font-weight: 300, line-height: 1.25 ),
h3: ( font-size: 2.2em, font-weight: 300, line-height: 1.30 ),
h4: ( font-size: 1.6em, font-weight: 300, line-height: 1.35 ),
h5: ( font-size: 1.2em, font-weight: 300, line-height: 1.5 ),
h6: ( font-size: 1.0em, font-weight: 300, line-height: 1.4 ),
);
// Specify each spacing that applies to Margin and Padding. Ex .m-0, .m-1, .mx-3, .pt-3, .mt-n3, etc
$spacing: (
0: 0em,
1: .5em,
2: 1em,
3: 2em,
4: 3em,
5: 4em,
);
// Specify each size that applies font-size and all elements using "em".
$sizes: (
xl: 140%,
lg: 120%,
md: 100%,
sm: 90%,
xs: 75%,
);
You can access variables using map-get()
p {
color: map-get($colors, 'primary');
margin-bottom: 1rem;
@media screen and (min-width: map-get($breakpoints, 'md')) {
margin-bottom: .5rem;
}
}
Paragraph Small - Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Paragraph - Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Paragraph Large - Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Blockquote - At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.- Blockquote, Cite
$types: (
body: ( font-family: Helvetica, font-size: clamp(.9rem, 3vw, 1.0rem), font-weight: 300, color: map-get($colors, 'text'), line-height: 1.4 ),
h1: ( font-size: 3.4em, font-weight: 400, line-height: 1.20 ),
h2: ( font-size: 2.7em, font-weight: 300, line-height: 1.25 ),
h3: ( font-size: 2.2em, font-weight: 300, line-height: 1.30 ),
h4: ( font-size: 1.6em, font-weight: 300, line-height: 1.35 ),
h5: ( font-size: 1.2em, font-weight: 300, line-height: 1.5 ),
h6: ( font-size: 1.0em, font-weight: 300, line-height: 1.4 ),
);
You can add as many types as you want. Each type will be assigned to the tag along with a custom
class so if needed you can apply .h2
to an H4, etc
By Default SpryCss uses em
to set font sizes, padding, heights, etc. So you can alter the sizes using the size classes.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr
Lorem ipsum dolor sit amet, consetetur sadipscing elitr
Lorem ipsum dolor sit amet, consetetur sadipscing elitr
Lorem ipsum dolor sit amet, consetetur sadipscing elitr
Lorem ipsum dolor sit amet, consetetur sadipscing elitr
The size classes are applied to all child elements so you can assign it to the parent.
$sizes: (
xl: 140%,
lg: 120%,
md: 100%,
sm: 90%,
xs: 75%,
);
.color-{color}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr
Lorem ipsum dolor sit amet, consetetur sadipscing elitr
Lorem ipsum dolor sit amet, consetetur sadipscing elitr
Lorem ipsum dolor sit amet, consetetur sadipscing elitr
.color-hover-{color}
.link-color-{color}
.link-color-hover-{color}
.bg-{color} .color-white
Lorem ipsum dolor sit amet, consetetur sadipscing elitr
.border .border-{color}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr
.btn .btn-{color}
.accent-{color}
Text with Border
.dark
to any
element to invert the "light" and "dark" color names.Text with Border
$colors: (
"white": #ffffff,
"light": #efefef,
"grey": #999999,
"dark": #444444,
"primary": #0D7FBF,
"warning": #df8a22,
"error": #d52929,
"success": #04ad3c,
"text": #566067,
"transparent": transparent,
)
You can add as many colors as you want, but each color will be added to all 4 types above. If you
only need it for a small thing then it would be better to create a custom variable for it.
SpryCSS doesn't come with its own icon package. You can use whatever ican package or icon webfont you want, but icon webfonts can greatly increase the size of your projects. A recommended alternative is to use direct svg code within your project. This produces the smallest file size while producing high resolution icons and allowing you the most flexibility to style the icons within your css.
A great option for this is Material Design Icons. You can search for icons and view the SVG code by clicking on the Code dropdown and click on 'View SVG'. Then copy and paste the code in your html.
If your using Visual Studio Code you can install the extension vscode-materialdesignicons-svg that provides code snippets to quickly add the SVG code.
* Note that the extension currently does not addfill="currentColor"
to the paths so you will need to add that
manually.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod temporinvidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
Learn MoreLorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr.
- Meta DataUse sup
for Upper Labels and sub
for Below Labels
form.sm
or form.lg
You can either use a 12 column css grid or flexbox grid system
grid
Grid of columns,
Uses variable $gaps
for spacing
row
Flex row of columns, Uses variable $gaps
for spacing
g-{size}
Gap for columns within grid
or row
. Default is
variable $gaps
columns-{size}
{size} can be 1-12
,
fixed
or
auto
(fixed and auto only apply to row
)
col-{size}
{size} can be 1-12
,
fixed
or
auto
(fixed and auto only apply to row
)
grid
-{size}00
Min width in px of child elements within container
{breakpoint}-
columns-{size}
{size} can be 1-12
,
fixed
or
auto
(fixed and auto only apply to row
)
{breakpoint}-
col-{size}
{size} can be 1-12
,
fixed
or
auto
(fixed and auto only apply to row
)
{breakpoint}-
g-{spacing}
Gap size for container
{size}
is 1-12
{spacing}
is defined by the
$spacing variable. See Spacing for more details
* gap
for flexbox is not
supported on older browsers. Also, custom gaps will not always work correctly with row
when setting specific column sizes. It works best if you
specify all breakpoint column sizes or use it with grid
instead
<nav class="list">
.list
modal
Main Modal
Classshow
Shows the Modal
blur
Adds blur to background
bounce
Adds bounce animation. Only occurs once.
no-backdrop
Removes the Backdrop and allows to click through the background.
Add max-width to modal-content to change size
These are basic lightweight sliders that do require minimal Javascript. You can extend the Javascript to make them more robust if you like. If your looking for something more robust, you might want to check out Swiper or Glide
<script defer src="https://cdn.jsdelivr.net/gh/ggedde/spry-css@2.3.23/dist/spry-slider.min.js"></script>
View full slider.js
You can add loading="lazy"
to the images, but it may be a little choppy when scrolling on some browsers. The Slider will detect the lazy loading images and pre load them on the next and previous slides. If you want a smooth transition it is best to load all the images initially.
Data Options:
data-loop
to allow the slides to loop.data-snap
to force stopping on each slide even when using grid layout. This is not forced with momentum scrolling.data-play="xxxx"
to enable autoplay in miliseconds.data-stop="hover|action"
'hover' to pause autoplay while hovering over slider or 'action' to pause autoplay while hovering over a link or button or making a text selection.Name | Size | Color | |
---|---|---|---|
Tier 1 | 200 | Red | Learn More |
Tier 2 | 400 | Blue | Learn More |
Tier 3 | 500 | Gold | Learn More |
Toggles are used to open and close content, menus, etc
You can create a toggle group by adding a <input type="checkbox" />
inside
a <label class="toggle">
then followed by your container of
your choice.
<label class="toggle">Toggle Handle
<input type="checkbox" />
</label>
<p>Toggle Content</p>
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Add .collapse
to your container
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
Add the .hoverable
class to the label
* To Remove the click option then just remove the checkbox and add the
.toggle
class to the label
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
You can create a tooltip by adding any tag with the class
tooltip
inside a container of your choice.
bold
{ font-weight: bold }
normal
{ font-weight: normal }
italic
{ font-style: italic }
uppercase
{ text-transform: uppercase }
lowercase
{ text-transform: lowercase }
capitalize
{ text-transform: capitalize }
pointer
{ cursor: pointer }
rounded
{ border-radius: 5px; overflow: hidden }
rounded-bottom
{ border-radius: 0 0 5px 5px }
circle
{ border-radius: 50% }
square
{ border-radius: 0 }
float-left
{ float: left }
float-right
{ float: right }
clear
{ clear: both }
index-1
{ z-index: 1 }
index-2
{ z-index: 2 }
index-3
{ z-index: 3 }
border
{ border: 1px solid map-get($colors, 'medium') }
border-top
{ border-top: 1px solid map-get($colors, 'medium') }
border-right
{ border-right: 1px solid map-get($colors, 'medium') }
border-bottom
{ border-bottom: 1px solid map-get($colors, 'medium') }
border-left
{ border-left: 1px solid map-get($colors, 'medium') }
note
{ font-style: italic; font-size: 90%; opacity: 0.8 }
truncate
{ max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
* All Layout Utility Classes can be used with breakpoints ex {breakpoint}-{layoutclass}
Example Hide on All
none
Example Hide on Mobile
none md-block
Example Hide on Tablets
md-none lg-block
{breakpoint}-
jc-between
{ justify-content: space-between }
{breakpoint}-
text-left
{ text-align: left }
{breakpoint}-
text-center
{ text-align: center }
{breakpoint}-
text-right
{ text-align: right }
{breakpoint}-
text-justify
{ text-align: justify }
{breakpoint}-
no-wrap
{ white-space: nowrap; flex-wrap: nowrap; }
{breakpoint}-
pre-wrap
{ white-space: pre-wrap }
{breakpoint}-
break-word
{ word-wrap: break-word }
{breakpoint}-
inline
{ display: inline; width: auto }
{breakpoint}-
flex
{ display: flex }
{breakpoint}-
block
{ display: block }
{breakpoint}-
none
{ display: none }
{breakpoint}-
inline-block
{ display: inline-block; width: auto }
{breakpoint}-
inline-flex
{ display: inline-flex; width: auto }
{breakpoint}-
table
{ display: table }
{breakpoint}-
table-cell
{ display: table-cell }
{breakpoint}-
relative
{ position: relative }
{breakpoint}-
absolute
{ position: absolute }
{breakpoint}-
collapse
{ position: relative }
{breakpoint}-
collapse > *
{ position: absolute }
{breakpoint}-
sticky
{ position: sticky; top: 0 }
{breakpoint}-
fixed
{ position: fixed }
{breakpoint}-
inset
{ position: absolute; inset: 0 }
{breakpoint}-
inset-top
{ position: absolute; top: 0; bottom: auto }
{breakpoint}-
inset-right
{ position: absolute; right: 0; left: auto }
{breakpoint}-
inset-bottom
{ position: absolute; bottom: 0; top: auto }
{breakpoint}-
inset-left
{ position: absolute; left: 0; right: auto }
{breakpoint}-
outset-top
{ position: absolute; bottom: 100%; top: auto }
{breakpoint}-
outset-right
{ position: absolute; left: 100%; right: auto }
{breakpoint}-
outset-bottom
{ position: absolute; top: 100%; bottom: auto }
{breakpoint}-
outset-left
{ position: absolute; right: 100%; left: auto }
{breakpoint}-
pointer-none
{ pointer-events: none }
{breakpoint}-
align-baseline
{ vertical-align: baseline }
{breakpoint}-
align-top
{ vertical-align: top }
{breakpoint}-
align-middle
{ vertical-align: middle }
{breakpoint}-
align-bottom
{ vertical-align: bottom }
{breakpoint}-
overflow-hidden
{ overflow: hidden }
{breakpoint}-
overflow-scroll
{ overflow: scroll }
{breakpoint}-
overflow-auto
{ overflow: auto }
{breakpoint}-
order-first
{ order:-1 }
{breakpoint}-
order-0
{ order:0 }
{breakpoint}-
order-1
{ order:1 }
{breakpoint}-
order-2
{ order:2 }
{breakpoint}-
order-3
{ order:3 }
{breakpoint}-
order-last
{ order:99999 }
{breakpoint}-
ai-start
{ align-items: flex-start }
{breakpoint}-
ai-end
{ align-items: flex-end }
{breakpoint}-
ai-center
{ align-items: center }
{breakpoint}-
ai-stretch
{ align-items: stretch }
{breakpoint}-
jc-start
{ justify-content: flex-start }
{breakpoint}-
jc-end
{ justify-content: flex-end }
{breakpoint}-
jc-center
{ justify-content: center }
{breakpoint}-
jc-between
{ justify-content: space-between }
{breakpoint}-
jc-around
{ justify-content: space-around }
{breakpoint}-
flex-middle
{ display: flex; align-items: center }
{breakpoint}-
flex-center
{ display: flex; align-items: center; justify-content: center }
{breakpoint}-
flex-wrap
{ flex-wrap: wrap }
{breakpoint}-
flex-column
{ flex-direction: column }
{breakpoint}-
shadow
{ box-shadow: 1px 3px 4px rgba(0,0,0,.12) }
{breakpoint}-
h-***
{ height: ***px; min-height: ***px; max-height: ***px }
{breakpoint}-
mh-***
{ max-height: ***px }
{breakpoint}-
vh-**
{ height: **vh }
{breakpoint}-
mvh-**
{ max-height: **vh }
{breakpoint}-
w-***
{ width: ***px; min-width: ***px; max-width: ***px }
{breakpoint}-
mw-***
{ max-width: ***px }
{breakpoint}-
vw-**
{ width: **vw }
{breakpoint}-
mvw-**
{ max-width: **vw }
{breakpoint}-
o-**
{ opacity: .** }
** = 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100
*** = 0, 100, 200, 300, 400, 500, 600, 700, 800, 900
This requires a breakpoint. ex {breakpoint}-mw
The classes are named using the format
{breakpoint}-
{property}{sides}-{spacing}
There are 3 Spacing properties:
p
= paddingm
= marginThere are 6 sides:
t
= topr
= rightb
= bottoml
= lefty
= top and bottomx
= left and rightThe sizes are used from the scss variable.
// SCSS Variable
$spacing: (
0: 0,
1: .5rem,
2: 1rem,
3: 2rem,
4: 4rem
);
For a negative margin you can include a negative value by placing a n
in
front of the value. ex mx-n2