From 173fb18813d0173d0545d8ca55ab4f6a76f7fdc9 Mon Sep 17 00:00:00 2001 From: Yan Zhu Date: Wed, 6 Apr 2016 17:15:29 +0800 Subject: add responsive breakpoint system code --- demo/index.html | 55 +++++++++++++++++++++++++++++++++++++++-------------- dist/spectre.css | 38 ++++++++++++++++++++++++++++++++++-- src/layout.less | 41 +++++++++++++++++++++++++++++++++++---- src/typography.less | 2 +- 4 files changed, 115 insertions(+), 21 deletions(-) diff --git a/demo/index.html b/demo/index.html index cfd8703..25343d4 100644 --- a/demo/index.html +++ b/demo/index.html @@ -15,6 +15,13 @@ padding: 1rem; border-radius: .3rem; } + .grid-hero { + margin-top: 10rem; + margin-bottom: 10rem; + } + .grid-hero h3 { + margin-bottom: 5rem; + } .notes { margin: 2rem 0; color: #666; @@ -22,19 +29,34 @@ -
-
+
+

Project Spectre

-

introduction

-
-

Project Spectre is a lightweight and clean CSS framework for faster and extendable development.

+
+

Project Spectre is a lightweight and clean CSS framework for faster and extendable development.

  • lightweight and clean starting point for your project
  • flexbox and responsive layout friendly
  • built in useful components and utilities
+
+ +
+
+
+

typography

@@ -96,7 +118,7 @@

flexbox layout

layout.less includes flexbox based grid system with 12 columns.

-

Add the class columns to a container. Add any element you want with class column inside the container. These columns will take up the space equally. You can specific the width of each column by adding class col-[1-12].

+

Add the class columns to a container. Add any element you want with classname column inside the container. These columns will take up the space equally. You can specific the width of each column by adding class col-[1-12].

@@ -208,6 +230,7 @@
+
button sizes

Add the class btn-sm or btn-lg for small or large size. Icons with the class icon can be correctly rendered in each button size. Also, you can add the class btn-block for a full-width button.

@@ -227,10 +250,8 @@ -
-
-

button groups

+
button groups

If you want to use buttons as a group, add the class btn-group to the container.

@@ -254,6 +275,10 @@

forms

+
+

forms.less provides the most common control styles used in forms, including label, input, textarea, select, checkbox, radio and switch.

+

+
@@ -375,10 +400,8 @@
-
-
-

input groups

+
input groups
@@ -400,10 +423,10 @@

media

- +
- +
@@ -541,6 +564,10 @@

labels

+
+

labels.less .

+

Add the class label to span elements.

+
default label diff --git a/dist/spectre.css b/dist/spectre.css index 5f698ed..622e322 100644 --- a/dist/spectre.css +++ b/dist/spectre.css @@ -416,7 +416,7 @@ h6 { font-weight: 300; line-height: 1.1; margin-top: 2.5rem; - margin-bottom: 1rem; + margin-bottom: 1.5rem; color: inherit; } h1 { @@ -558,8 +558,17 @@ ol ol { padding-right: 1rem; } @media screen and (min-width: 961px) { - .container.grid-960 { + .grid-960 { width: 96rem; + margin-left: auto; + margin-right: auto; + } +} +@media screen and (min-width: 481px) { + .grid-480 { + width: 48rem; + margin-left: auto; + margin-right: auto; } } .columns { @@ -634,6 +643,31 @@ ol ol { width: 8.33333333%; } } +@media screen and (max-width: 480px) { + .hide-xs { + display: none !important; + } +} +@media screen and (max-width: 600px) { + .hide-sm { + display: none !important; + } +} +@media screen and (max-width: 840px) { + .hide-md { + display: none !important; + } +} +@media screen and (max-width: 960px) { + .hide-lg { + display: none !important; + } +} +@media screen and (max-width: 1280px) { + .hide-xl { + display: none !important; + } +} .img-responsive { display: block; max-width: 100%; diff --git a/src/layout.less b/src/layout.less index b101ca0..ccdd609 100644 --- a/src/layout.less +++ b/src/layout.less @@ -8,10 +8,17 @@ &:extend(.clearfix all); } @media screen and (min-width: 961px) { - .container { - &.grid-960 { - width: 96rem; - } + .grid-960 { + width: 96rem; + margin-left: auto; + margin-right: auto; + } +} +@media screen and (min-width: 481px) { + .grid-480 { + width: 48rem; + margin-left: auto; + margin-right: auto; } } @@ -82,3 +89,29 @@ } } +// Responsive breakpoint system +@media screen and (max-width: 480px) { + .hide-xs { + display: none !important; + } +} +@media screen and (max-width: 600px) { + .hide-sm { + display: none !important; + } +} +@media screen and (max-width: 840px) { + .hide-md { + display: none !important; + } +} +@media screen and (max-width: 960px) { + .hide-lg { + display: none !important; + } +} +@media screen and (max-width: 1280px) { + .hide-xl { + display: none !important; + } +} \ No newline at end of file diff --git a/src/typography.less b/src/typography.less index bd4c576..0051ba0 100644 --- a/src/typography.less +++ b/src/typography.less @@ -8,7 +8,7 @@ h6 { font-weight: 300; line-height: 1.1; margin-top: 2.5rem; - margin-bottom: 1rem; + margin-bottom: 1.5rem; color: inherit; } h1 { -- cgit v1.3.1-26-gb76a