A
Lightweight,
Responsive and
diff --git a/docs/layout.html b/docs/layout.html
index f3549b5..11f9ab6 100644
--- a/docs/layout.html
+++ b/docs/layout.html
@@ -6,6 +6,7 @@
+
@@ -13,6 +14,7 @@
+
diff --git a/docs/src/_layout.pug b/docs/src/_layout.pug
index ad32f32..511d798 100644
--- a/docs/src/_layout.pug
+++ b/docs/src/_layout.pug
@@ -1,6 +1,15 @@
+block global
+ - var domain = 'https://picturepan2.github.io/spectre/'
+
block variables
+ - var slug = ''
- var title = 'Spectre.css - A Lightweight, Responsive and Modern CSS Framework'
- - var description = ''
+ - var description = 'Spectre.css is a lightweight, responsive and modern CSS framework for faster and extensible development. Spectre provides basic styles for typography and elements, flexbox based responsive layout system, pure CSS components and utilities with best practice coding and consistent design language.'
+
+if slug
+ - var url = domain + slug + '.html'
+else
+ - var url = domain
doctype html
html(lang='en')
@@ -10,6 +19,7 @@ html(lang='en')
meta(name='robots' content='index, follow')
meta(name='viewport' content='width=device-width, initial-scale=1.0, shrink-to-fit=no')
meta(http-equiv='x-ua-compatible' content='ie=edge')
+ meta(name='description' content= description)
meta(name='author' content='Yan Zhu')
link(rel='shortcut icon' href='img/favicons/favicon.ico')
link(rel='icon' href='img/favicons/favicon.png')
@@ -17,6 +27,7 @@ html(lang='en')
link(rel='stylesheet' href='dist/spectre-icons.min.css')
link(rel='stylesheet' href='dist/spectre-exp.min.css')
link(rel='stylesheet' href='dist/docs.min.css')
+ link(rel='canonical' href= url)
body
block content
diff --git a/docs/src/_mixins.pug b/docs/src/_mixins.pug
index fa08cf6..e9f125e 100644
--- a/docs/src/_mixins.pug
+++ b/docs/src/_mixins.pug
@@ -1,6 +1,6 @@
mixin docs-accordion(id, name, ...pages)
.accordion
- input(id='accordion-' + id type='checkbox' name='docs-accordion-checkbox' hidden='' checked=(current === id ? true : false))
+ input(id='accordion-' + id type='checkbox' name='docs-accordion-checkbox' hidden='' checked=(slug === id ? true : false))
label.accordion-header.c-hand(for='accordion-' + id)= name
.accordion-body
ul.menu.menu-nav
diff --git a/docs/src/components.pug b/docs/src/components.pug
index 3af49c8..a9150d8 100644
--- a/docs/src/components.pug
+++ b/docs/src/components.pug
@@ -1,9 +1,9 @@
extends _docs-layout.pug
block variables
+ - var slug = 'components'
- var title = 'Components - Spectre.css CSS Framework'
- - var description = ''
- - var current = 'components'
+ - var description = 'Spectre.css is a lightweight, responsive and modern CSS framework for faster and extensible development. Spectre provides basic styles for typography and elements, flexbox based responsive layout system, pure CSS components and utilities with best practice coding and consistent design language.'
block docs-content
//- Accordions
diff --git a/docs/src/elements.pug b/docs/src/elements.pug
index 3f2086f..17ea619 100644
--- a/docs/src/elements.pug
+++ b/docs/src/elements.pug
@@ -1,9 +1,9 @@
extends _docs-layout.pug
block variables
+ - var slug = 'elements'
- var title = 'Elements - Spectre.css CSS Framework'
- - var description = ''
- - var current = 'elements'
+ - var description = 'Spectre.css is a lightweight, responsive and modern CSS framework for faster and extensible development. Spectre provides basic styles for typography and elements, flexbox based responsive layout system, pure CSS components and utilities with best practice coding and consistent design language.'
block docs-content
//- Typography
diff --git a/docs/src/experimentals.pug b/docs/src/experimentals.pug
index 41936b6..c888878 100644
--- a/docs/src/experimentals.pug
+++ b/docs/src/experimentals.pug
@@ -1,9 +1,9 @@
extends _docs-layout.pug
block variables
+ - var slug = 'experimentals'
- var title = 'Experimentals - Spectre.css CSS Framework'
- - var description = ''
- - var current = 'experimentals'
+ - var description = 'Spectre.css is a lightweight, responsive and modern CSS framework for faster and extensible development. Spectre provides basic styles for typography and elements, flexbox based responsive layout system, pure CSS components and utilities with best practice coding and consistent design language.'
block docs-content
//- Experimentals
diff --git a/docs/src/getting-started.pug b/docs/src/getting-started.pug
index 60e1665..89c668b 100644
--- a/docs/src/getting-started.pug
+++ b/docs/src/getting-started.pug
@@ -1,9 +1,9 @@
extends _docs-layout.pug
block variables
+ - var slug = 'getting-started'
- var title = 'Getting started - Spectre.css CSS Framework'
- - var description = ''
- - var current = 'getting-started'
+ - var description = 'Spectre.css is a lightweight, responsive and modern CSS framework for faster and extensible development. Spectre provides basic styles for typography and elements, flexbox based responsive layout system, pure CSS components and utilities with best practice coding and consistent design language.'
block docs-content
//- Introduction
diff --git a/docs/src/index.pug b/docs/src/index.pug
index 58de518..791a813 100644
--- a/docs/src/index.pug
+++ b/docs/src/index.pug
@@ -7,7 +7,7 @@ block content
a.docs-logo(href='index.html')
img(src='img/spectre-logo.svg' alt='Spectre.css CSS Framework')
h2 SPECTRE
- h1 Spectre.css
+ h1 SPECTRE.CSS
h2
| A #[u Lightweight], #[u Responsive] and #[u Modern] CSS Framework
p
diff --git a/docs/src/layout.pug b/docs/src/layout.pug
index 4b1bd50..9df424a 100644
--- a/docs/src/layout.pug
+++ b/docs/src/layout.pug
@@ -1,9 +1,9 @@
extends _docs-layout.pug
block variables
+ - var slug = 'layout'
- var title = 'Layout - Spectre.css CSS Framework'
- - var description = ''
- - var current = 'layout'
+ - var description = 'Spectre.css is a lightweight, responsive and modern CSS framework for faster and extensible development. Spectre provides basic styles for typography and elements, flexbox based responsive layout system, pure CSS components and utilities with best practice coding and consistent design language.'
block docs-content
//- Flexbox grid
diff --git a/docs/src/utilities.pug b/docs/src/utilities.pug
index c9e8ba2..e3a2b5f 100644
--- a/docs/src/utilities.pug
+++ b/docs/src/utilities.pug
@@ -1,9 +1,9 @@
extends _docs-layout.pug
block variables
+ - var slug = 'utilities'
- var title = 'Utilities - Spectre.css CSS Framework'
- - var description = ''
- - var current = 'utilities'
+ - var description = 'Spectre.css is a lightweight, responsive and modern CSS framework for faster and extensible development. Spectre provides basic styles for typography and elements, flexbox based responsive layout system, pure CSS components and utilities with best practice coding and consistent design language.'
block docs-content
//- Colors
diff --git a/docs/utilities.html b/docs/utilities.html
index eb89ed7..7fad7e0 100644
--- a/docs/utilities.html
+++ b/docs/utilities.html
@@ -6,6 +6,7 @@
+
@@ -13,6 +14,7 @@
+
Please note that you could use the btn-action class for a square button, or add another circle class for a round button, which is often used as a Float Action Button (FAB).
+
Please note that you could use the btn-action class for a square button, or add another s-circle class for a round button, which is often used as a Float Action Button (FAB).
<!-- standard Accordions example -->
-<divclass="accordion">
- <inputtype="checkbox"id="accordion-1"name="accordion-checkbox"hidden>
- <labelclass="accordion-header"for="accordion-1">
- <iclass="icon icon-arrow-right mr-1"></i>
- Title
- </label>
- <divclass="accordion-body">
- <!-- Accordions content -->
- </div>
-</div>
-
-<!-- mutually exclusive Accordions example (with same input names) -->
-<divclass="accordion">
- <inputtype="radio"id="accordion-1"name="accordion-radio"hidden>
- <labelclass="accordion-header"for="accordion-1">
- Title
- </label>
- <divclass="accordion-body">
- <!-- Accordions content -->
- </div>
-</div>
-
-
Alternatively, you can use details and summary instead of input radio or checkbox trick.
- Add the open attribute to details to expand it.
- Microsoft Edge support is under consideration.
-
-
<!-- details and summary Accordions example -->
-<detailsclass="accordion"open>
- <summaryclass="accordion-header">
- <iclass="icon icon-arrow-right mr-1"></i>
- Title
- </summary>
- <divclass="accordion-body">
- <!-- Accordions content -->
- </div>
-</details>
Add the avatar class to <img> element.
- There are 4 additional sizes available, including avatar-xl(64px), avatar-lg(48px), avatar-sm(24px), and avatar-xs(16px).
- By default, the avatar size is 32px.
-
-
- For users who don't have profile pictures, you may use their initials for avatars.
- Add the avatar class and avatar size class to <div> element.
- The data-initial attribute is the name appear inside the avatar.
-
-
<!-- Basic avatar examples -->
-<figureclass="avatar avatar-xl">
- <imgsrc="img/avatar-1.png"alt="...">
-</figure>
-
-<figureclass="avatar avatar-xl"data-initial="YZ"style="background-color: #5755d9;"></figure>
-
-<!-- Show initals when avatar image is unavailable or not fully loaded -->
-<figureclass="avatar avatar-xl"data-initial="YZ"style="background-color: #5755d9;">
- <imgsrc="img/avatar-1.png"alt="...">
-</figure>
-
- Avatars support presence indicators.
- You can add an <i> element with the avatar-presence class, and add online, busy or away class for different status colors.
- The default is gray which means offline.
-
Badges are often used as unread number indicators.
-
-
Notifications
-
Notifications
-
Notifications
-
Notifications
-
-
Add the badge class to non self closing elements.
- And add the data-badge attribute to define the content of a badge.
- The badge will appear in the top-right direction of the element.
-
-
If there is no data-badge or the attribute is not specified, the badge will appear as a dot.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Badges support button and avatars elements as well.
- Bars represent the progress of a task or the value within the known range.
- Bars are custom components for displaying HTML5 <progress>, <meter> and input range elements.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
25%
-
15%
-
10%
-
15%
-
-
-
-
Add a container element with the bar class.
- And add child elements with the bar-item class.
- The width percentage value is needed for every bar-item.
-
-
There is the bar-sm class for thinner Bars.
- Also, you could use Tooltips for any bar-item.
-
You can add the bar-slider class to the Bars container.
- And add child elements with the bar-item class and bar-slider-btn inside bar-item.
- You need to set the bar-item width manually to have the slider point.
-
-
If there are two bar-item divs in one bar-slider, you will have a range slider.
Empower every person and every organization on the planet to achieve more.
-
-
-
-
-
-
-
Apple
-
Hardware and software
-
-
-
To make a contribution to the world by making tools for the mind that advance humankind.
-
-
-
-
-
-
-
-
-
Google I/O
-
Software and hardware
-
-
An immersive, three-day experience focused on exploring the next generation of technology, mobile and beyond.
-
-
-
-
-
-
-
Surface Studio. Turn your desk into a Studio. Surface Studio is designed for the creative process.
-
-
-
-
-
-
Apple
-
Hardware and software
-
-
To make a contribution to the world by making tools for the mind that advance humankind.
-
-
-
-
-
-
-
Google
-
Software and hardware
-
-
Organize the world’s information and make it universally accessible and useful.
-
-
-
-
-
-
Add a container element with the card class.
- And add child elements with the card-image, card-header, card-body and/or card-footer classes.
- The card-image can be placed in any position.
-
Empty states/blank slates are commonly used as placeholders for first time use, empty data and error screens.
-
-
-
-
-
You have no new messages
-
Click the button to start a conversation
-
-
-
-
-
-
-
-
-
You've successfully signed up
-
Click the button to invite your friends
-
-
-
-
-
-
-
-
-
-
-
-
You are not following anyone
-
Start to meet new friends
-
-
-
-
-
-
-
-
- An empty state component can include icons, messages (title and subtitle messages) and action buttons or any combination of those elements.
- Add empty-icon, empty-title, empty-subtitle or empty-action to the elements.
- HTML structure is exampled below.
-
-
<divclass="empty">
- <divclass="empty-icon">
- <iclass="icon icon-people"></i>
- </div>
- <pclass="empty-title h5">You have no new messages</p>
- <pclass="empty-subtitle">Click the button to start a conversation.</p>
- <divclass="empty-action">
- <buttonclass="btn btn-primary">Send a message</button>
- </div>
-</div>
Add a container element with the menu class.
- And add child elements with the menu-item class.
- You can separate menu items with a divider.
- Spectre.css does not include JavaScript code, you will need to implement your JS to interact with the menus.
-
-
Menus also have Form controls (checkbox, radio and checkbox) support.
-
<ulclass="menu">
- <!-- menu header text -->
- <liclass="divider"data-content="LINKS">
- </li>
- <!-- menu item standard -->
- <liclass="menu-item">
- <ahref="#">
- <iclass="icon icon-link"></i> Slack
- </a>
- </li>
- <!-- menu item with form control -->
- <liclass="menu-item">
- <labelclass="form-checkbox">
- <inputtype="checkbox">
- <iclass="form-icon"></i> form-checkbox
- </label>
- </li>
- <!-- menu divider -->
- <liclass="divider"></li>
- <!-- menu item with badge -->
- <liclass="menu-item">
- <divclass="menu-badge">
- <labelclass="label label-primary">2</label>
- </div>
- <ahref="#">
- <iclass="icon icon-link"></i> Settings
- </a>
- </li>
-</ul>
-
Dropdown menus component is built entirely in CSS. It is triggered by :focus event.
-
Add a container element with the dropdown class.
- And add a focusable element with the dropdown-toggle class for the button and a menu component right next to it.
- You also need to add tabindex to make the buttons focusable.
-
-
If the dropdown is close to the right edge of the browser, you can add the dropdown-right class to the container to prevent it appearing off screen.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent risus leo, dictum in vehicula sit amet, feugiat tempus tellus. Duis quis sodales risus. Etiam euismod ornare consequat.
-
Climb leg rub face on everything give attitude nap all day for under the bed. Chase mice attack feet but rub face on everything hopped up on goofballs.
Efficiently unleash cross-media information without cross-media value. Quickly maximize timely deliverables for real-time schemas. Dramatically maintain clicks-and-mortar.
-
Caerphilly swiss fromage frais. Brie cheese and wine fromage frais chalk and cheese danish fontina smelly cheese who moved my cheese cow.
-
-
-
-
-
-
-
-
Add a container element with the modal class.
- And add a real container modal-container and overlay modal-overlay inside it.
- You can add child elements with the modal-header, modal-body and modal-footer - any or all of them.
-
-
- Spectre.css does not include JavaScript code, you will need to implement your JS to interact with modals.
- To make a modal appear, add the active class to the modal container.
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent risus leo, dictum in vehicula sit amet, feugiat tempus tellus. Duis quis sodales risus. Etiam euismod ornare consequat.
-
Climb leg rub face on everything give attitude nap all day for under the bed. Chase mice attack feet but rub face on everything hopped up on goofballs.
Add a container element with the nav class.
- And add child elements with the nav-item class.
- The nav-item with the active class will be highlighted.
-
Add a container element with the pagination class.
- And add child elements with the page-item class.
- The page-item with the active class will be highlighted.
- You can add the disabled class to the page-item to have unclickable page links.
-
Panels are flexible view container with auto-expand content section.
-
-
-
-
-
-
Bruce Banner
-
THE HULK
-
-
-
-
-
-
E-mail
-
bruce.banner@hulk.com
-
-
-
-
-
-
-
-
Skype
-
bruce.banner
-
-
-
-
-
-
-
-
Location
-
Dayton, Ohio
-
-
-
-
-
-
-
-
-
-
-
-
-
Comments
-
-
-
-
-
-
-
-
Thor Odinson
-
Earth's Mightiest Heroes joined forces to take on threats that were too big for any one hero to tackle...
-
-
-
-
-
-
-
-
Bruce Banner
-
The Strategic Homeland Intervention, Enforcement, and Logistics Division...
-
-
-
-
-
-
-
-
Tony Stark
-
Earth's Mightiest Heroes joined forces to take on threats that were too big for any one hero to tackle...
-
-
-
-
-
-
-
-
Steve Rogers
-
The Strategic Homeland Intervention, Enforcement, and Logistics Division...
-
-
-
-
-
-
-
-
Natasha Romanoff
-
Earth's Mightiest Heroes joined forces to take on threats that were too big for any one hero to tackle...
-
-
-
-
-
-
-
-
Add a container element with the panel class.
- And add child elements with the panel-header, panel-nav, panel-body and/or panel-footer classes.
- The panel-body can be auto expanded and vertically scrollable.
-
To make a contribution to the world by making tools for the mind that advance humankind.
-
-
-
-
-
-
-
Wrap an element by a container with the popover class.
- And add a container with the popover-container next to the element.
- You can use Cards component inside the popover-container.
-
-
Also, you can add the popover-right, popover-bottom or popover-left class to define the position.
- By default, the popovers appear above the element.
-
Add a container element with the step class.
- And add child elements with the step-item class.
- The step-item with the active class will be highlighted and indicate the current state of progress.
-
Add a container element with the tab class.
- And add child elements with the tab-item class.
- You can add the tab-block class for a full-width tab.
- The tab-item or its child <a> with the active class will be highlighted.
-
Tiles are repeatable or embeddable information blocks.
-
-
-
-
-
-
-
-
The Avengers
-
Earth's Mightiest Heroes joined forces to take on threats that were too big for any one hero to tackle...
-
-
-
-
-
-
-
-
-
-
-
-
-
-
The S.H.I.E.L.D.
-
The Strategic Homeland Intervention, Enforcement, and Logistics Division...
-
-
-
-
-
-
-
-
-
Add a container with the tile class.
- And add child elements with the tile-icon, tile-content or/and tile-action classes.
- The tile-icon and tile-action are optional.
-
-
There are tile-title and tile-subtitle classes for title and subtitle text styles.
-
<divclass="tile">
- <divclass="tile-icon">
- <divclass="example-tile-icon">
- <iclass="icon icon-file centered"></i>
- </div>
- </div>
- <divclass="tile-content">
- <pclass="tile-title">The Avengers</p>
- <pclass="tile-subtitle text-gray">Earth's Mightiest Heroes joined forces to take on threats that were too big for any one hero to tackle...</p>
- </div>
- <divclass="tile-action">
- <buttonclass="btn btn-primary">Join</button>
- </div>
-</div>
-
Toasts are used to show alert or information to users.
-
-
-
-
-
Toast Title
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
-
-
-
-
- Lorem ipsum dolor sit amet, consectetur adipiscing elit.
-
-
-
-
Add a container element with the toast class.
- You can add any text within the container, and even icons.
- You may also add a close button with the btn-clear class if you need.
-
-
<divclass="toast">
- Lorem ipsum dolor sit amet, consectetur adipiscing elit.
-</div>
-
-
-
-
- Toast success
-
-
-
-
- Toast warning
-
-
-
-
- Toast error
-
-
-
-
And you can add the toast-primary, toast-success, toast-warning or toast-error class for additional toast colors.
-
<divclass="toast toast-primary">
- <buttonclass="btn btn-clear float-right"></button>
- Lorem ipsum dolor sit amet, consectetur adipiscing elit.
-</div>
Tooltips provide context information labels that appear on hover and focus.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Tooltips component is built entirely in CSS.
-
Add the tooltip class and the data-tooltip attribute, which contains the tooltip content, to non self closing elements.
-
And add the tooltip-right, tooltip-bottom or tooltip-left class to define the position of a tooltip.
- By default, the tooltip appears above the element.
-
-
<buttonclass="btn tooltip"data-tooltip="Lorem ipsum dolor sit amet">top tooltip</button>
-<buttonclass="btn tooltip tooltip-right"data-tooltip="Lorem ipsum dolor sit amet">right tooltip</button>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
- Praesent risus leo, dictum in vehicula sit amet, feugiat tempus tellus. Duis quis sodales risus. Etiam euismod ornare consequat.
-
-
Climb leg rub face on everything give attitude nap all day for under the bed. Chase mice attack feet but rub face on everything hopped up on goofballs.
-
<p>Lorem ipsum dolor sit amet, ...</p>
-<p>...</p>
-
나라말이 중국과 달라, 한문・한자와 서로 통하지 아니하므로, 어리석은 백성들이 말하고자 하는 바가 있어도, 끝내 제 뜻을 펴지 못하는 사람이 많다. 내가 이를 불쌍히 여겨, 새로 스물 여덟 글자를 만드니, 사람마다 하여금 쉽게 익혀, 날마다 씀에 편하게 하고자 할 따름이다.
-
-
-
Use the lang attribute to the container element to have better Asian CJK (Chinese, Japanese and Korean) font support.
-
<plang="zh-Hans">革命不是请客吃饭,不是做文章……</p>
-<plang="ja">祇園精舎の鐘の声、諸行無常の響きあり……</p>
-<plang="ko">나라말이 중국과 달라, 한문・한자와 서로 통하지 아니하므로……</p>
-
-
And you can use the cjk class or the lang attribute to add spacing between underlines and strike-through text for better Chinese and Japanese readability.
Spectre sets the most common and best font-family for each OS with fallback support in old systems.
- There are also fonts targeted East Asian typography.
-
The advance of technology is based on making it fit in so that you don't really even notice it, so it's part of everyday life.
- - Bill Gates
-
-
<blockquote>
- <p>The advance of technology is based on making it fit in so that you don't really even notice it, so it's part of everyday life. </p>
- <cite>- Bill Gates</cite>
-</blockquote>
-
Tables include default styles for tables and data sets.
-
-
-
-
-
-
Name
-
Genre
-
Release date
-
-
-
-
-
The Shawshank Redemption
-
Crime, Drama
-
14 October 1994
-
-
-
The Godfather
-
Crime, Drama
-
24 March 1972
-
-
-
Schindler's List
-
Biography, Drama, History
-
4 February 1994
-
-
-
Se7en
-
Crime, Drama, Mystery
-
22 September 1995
-
-
-
-
-
-
Add the table class to any <table> element.
- The class will add padding, border and emphasized table header.
- Use the table-striped class to <table> to add zebra striped style.
- For hoverable table rows, you can add the table-hover class to enable hover style.
-
-
Use the active class to make <tr> element highlighted.
Buttons include simple button styles for actions in different types and sizes.
-
-
-
-
-
-
-
-
Add the btn class to <a>, <input> or <button> elements for a default button.
- There are classes btn-primary and btn-link for predefined primary and link buttons.
-
Add the btn-success or btn-error class for success (green) or error (red) button color.
- If you need more button colors, please use button mixins to create your own button color variants.
-
Please note that you could use the btn-action class for a square button, or add another s-circle class for a round button, which is often used as a Float Action Button (FAB).
If you want to use buttons as a group, add the btn-group class to the container.
- You can add the btn-group-block class for a full-width button group.
-
Forms provide the most common control styles used in forms, including input, textarea, select, checkbox, radio and switch.
-
-
-
-
-
-
-
-
-
-
-
-
-
<!-- form input control -->
-<divclass="form-group">
- <labelclass="form-label"for="input-example-1">Name</label>
- <inputclass="form-input"type="text"id="input-example-1"placeholder="Name">
-</div>
-
-
-
-
-
-
-
-
-
-
<!-- form textarea control -->
-<divclass="form-group">
- <labelclass="form-label"for="input-example-3">Message</label>
- <textareaclass="form-input"id="input-example-3"placeholder="Textarea"rows="3"></textarea>
-</div>
-
-
-
-
-
-
-
-
-
-
-
-
<!-- form select control -->
-<divclass="form-group">
- <selectclass="form-select">
- <option>Choose an option</option>
- <option>Slack</option>
- <option>Skype</option>
- <option>Hipchat</option>
- </select>
-</div>
-
-
-
-
-
-
-
<!-- form radio control -->
-<divclass="form-group">
- <labelclass="form-label">Gender</label>
- <labelclass="form-radio">
- <inputtype="radio"name="gender"checked>
- <iclass="form-icon"></i> Male
- </label>
- <labelclass="form-radio">
- <inputtype="radio"name="gender">
- <iclass="form-icon"></i> Female
- </label>
-</div>
-
-
-
-
-
-
-
-
-
-
-
-
<!-- form switch control -->
-<divclass="form-group">
- <labelclass="form-switch">
- <inputtype="checkbox">
- <iclass="form-icon"></i> Send me emails with news and tips
- </label>
-</div>
-
-
-
-
-
-
-
-
-
-
-
-
<!-- form checkbox control -->
-<divclass="form-group">
- <labelclass="form-checkbox">
- <inputtype="checkbox">
- <iclass="form-icon"></i> Remember me
- </label>
-</div>
-
-
-
-
-
-
-
-
-
-
You can change checkbox to indeterminate state by setting the indeterminate property of input checkboxes to true.
If you want to have a horizontal form, add the form-horizontal class to the <form> container.
- And add the col-<1-12> and col-xs/sm/lg/xl-<1-12> class to the child elements for responsive form row layout.
-
For smaller or larger input and select controls, you could add the input-sm/input-lg, select-sm/select-lg and label-sm/label-lg classes to the elements.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
You can add the input-sm/input-lg classes to the input-checkbox, input-radio and input-switch to have different sizes.
If you want to attach text and button along with an input, add the input-group class to the input container.
- And add the input-group-addon class to the text element and input-group-btn to the button element.
-
-
<!-- normal input group -->
-<divclass="input-group">
- <spanclass="input-group-addon">...</span>
- <inputtype="text"class="form-input"placeholder="...">
-</div>
-
-<!-- large input group -->
-<divclass="input-group">
- <spanclass="input-group-addon addon-lg">...</span>
- <inputtype="text"class="form-input input-lg"placeholder="...">
-</div>
-
-<!-- normal input group with button -->
-<divclass="input-group">
- <spanclass="input-group-addon">...</span>
- <inputtype="text"class="form-input"placeholder="...">
- <buttonclass="btn btn-primary input-group-btn">Submit</button>
-</div>
-
To use form validation styles, you can either add is-success or is-error class to the controls or add has-success or has-error class to parent elements.
- Use the form-input-hint class to provide form validation success and error messages.
-
-
<form>
- <!-- form validation class: has-success -->
- <divclass="form-group has-success">
- <labelclass="form-label"for="input-example-1">Name</label>
- <inputclass="form-input"type="text"id="input-example-1"placeholder="...">
- <pclass="form-input-hint">The name is invalid.</p>
- </div>
-
- <!-- form validation class: is-success -->
- <divclass="form-group">
- <labelclass="form-label"for="input-example-1">Name</label>
- <inputclass="form-input is-success"type="text"id="input-example-1"placeholder="...">
- <pclass="form-input-hint">The name is invalid.</p>
- </div>
-
- <!-- form validation example for checkbox, radio and switch -->
- <divclass="form-group">
- <labelclass="form-checkbox is-error">
- <inputtype="checkbox">
- <iclass="form-icon"></i> Remember me
- </label>
- </div>
-</form>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
You can use input pattern attribute to validate the value as well.
-
<!-- pattern validation example for Email -->
-<inputclass="form-input"type="email"placeholder="Email"pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,14}$">
-
-<!-- pattern validation example for password (8 or more characters that are of at least one number, and one uppercase and lowercase letter) -->
-<inputclass="form-input"type="password"placeholder="Password"pattern="^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9]).{8,}$">
-
- Icons are single-element, responsive and pure CSS icons.
- You can include spectre-icons.css located in the dist folder to your web <head> to have these CSS icons.
-
Add the label class to <span> or <small> elements.
- You can add another class label-primary, label-secondary, label-success, label-warning and label-error for colored labels.
-
-
<!-- normal labels -->
-<spanclass="label">default label</span>
-<spanclass="label label-primary">primary label</span>
-
-
-
default labelprimary label
-
-
Add the label-rounded class to have rounded labels.
Code is used for styling inline and multiline code snippets.
-
For inline code, you can use the <code> element.
- For multiline code snippet blocks, you can use <pre> with the code class as a container, and add <code> inside it.
- The data-lang attribute is rendered as the language name in the top right.
-
Add the img-responsive class to <img> elements. The images will scale with the parent sizes.
-
-
-
-
Add the img-fit-contain or img-fit-cover class to <img> or <video> elements. The media will crop itself to fit inside the element (and you don't need another container).
- This feature can replace the classic background image trick. Microsoft Edge support is shipped with Build Number 16299+.
-
You can use the element <figure> for an image with a caption.
- Add the figure class to <figure> element.
- The images with the img-responsive class will be responsive.
- And the included class figure-caption will provide basic style for caption.
- Also, you can use text-left, text-center and text-right for caption alignment.
-
For responsive video, add a container with the video-responsive class.
- Insert any YouTube, Youku or other iframe/embed video inside the container.
- The ratio is 16:9 by default.
- You may add video-responsive-4-3 for 4:3 ratio video container or video-responsive-1-1 for 1:1 ratio.
-
-
-
-
-
-
-
-
-
For responsive <video> elements, you can add the video-responsive class directly.
Add a container element with the form-autocomplete class.
- There are 2 parts of it, one is form-autocomplete-input, another is menu component.
- You may add the is-focused class to form-autocomplete-input to make it appear as focus state.
-
-
- Spectre.css does NOT include JavaScript code, you will need to implement your JS to interact with the autocomplete.
- The autocomplete HTML structure is exampled below.
-
Filters use tag-1 to tag-8 to flag different tags.
- tag-0 is reserved for clearing filter (or showing all).
- You can overwrite $filter-number in _filters.scss to have more filters.
-
Meters represent the value within the known range.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
<!-- Meter is green when low < value < high -->
-<meterclass="meter"value="20"min="0"max="100"></meter>
-<meterclass="meter"value="60"min="0"max="100"low="30"high="80"></meter>
-<!-- Meter is yellow when value < low or high < value -->
-<meterclass="meter"value="85"min="0"max="100"low="30"high="80"></meter>
-<!-- Meter is red when value < low < high < optimum or optimum < low < high < value -->
-<meterclass="meter"value="20"optimum="90"min="0"max="100"low="30"high="80"></meter>
The Off-canvas is a navigation layout that the sidebar can slide in and out of the viewport. It is built in pure CSS.
-
- By default, the off-canvas menu is collapsed whenever the window width is.
- But you can add the off-canvas-sidebar-show class to the off-canvas to make the sidebar expanded when the window width is larger than or equal to 960px.
-
-
-
-
-
Sidebar
-
-
-
Lorem ipsum
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent risus leo, dictum in vehicula sit amet, feugiat tempus tellus. Duis quis sodales risus. Etiam euismod ornare consequat.
-
Climb leg rub face on everything give attitude nap all day for under the bed. Chase mice attack feet but rub face on everything hopped up on goofballs.
-
-
-
-
-
-
You can open the sidebar by adding the class active to off-canvas-sidebar.
- And remove the active to close it.
-
Spectre.css is a lightweight, responsive and modern CSS framework for faster and extensible development.
-
- Spectre provides basic styles for typography and elements, flexbox based responsive layout system, pure CSS components and utilities with best practice coding and consistent design language.
It is recommended to customize Spectre by importing Sass source files to your projects. In this way, you can keep Spectre up to date without conflicts, since Spectre code and your custom code are separate.
Then create your project-name.scss file in the root folder. You can use project-name.scss to define your variables.
-
Compile the Sass file to CSS to get the custom version of Spectre.
-
-
// Example of project-name.scss
-// Define variables to override default ones
-$primary-color: #2e5bec;
-$dark-color: #3e396b;
-
-// Import full Spectre source code
-@import"node_modules/spectre.css/src/spectre";
-
-
Alternatively, you can create custom _variables.scss and import it to project-name.scss.
-
// Example of project-name.scss
-@import"variables";
-
-// Import only the needed components
-@import"node_modules/spectre.css/src/buttons";
-@import"node_modules/spectre.css/src/forms";
-
Spectre.css is designed with consistent design language. You can use your own variables to create your new or match existing design. All variables in _variables.scss include !default flag. You can redefine the variables to override the values.
<!-- filled button with the success color -->
-.btn-success {
- @include button-variant($success-color);
-}
-
-<!-- outlined button with the success color -->
-.btn-outline-success {
- @include button-outline-variant($success-color);
-}
-
The default REM (root em) size in Spectre.css is 20px.
-
Please note in the Chinese/Japanese/Korean version, Chrome uses 12px as default minimum font size. That is why Spectre sets rem default html font size to 20px, which is relatively easy to calculate.
-
Spectre uses 4px as the unit size. Sizes of components are based on the unit size.
Spectre uses Autoprefixer to make most styles compatible with earlier browsers and Normalize.css for CSS resets. Spectre is designed for modern browsers. For best compatibility, these browsers are recommended:
-
-
Chrome LAST 4
-
Microsoft Edge LAST 4
-
Firefox Extended Support Release
-
Safari LAST 4
-
Opera LAST 4
-
Internet Explorer 10+
-
-
Spectre supports Internet Explorer 10+, but some HTML5 and CSS3 features are not perfectly supported by Internet Explorer.
I have updated the whole Spectre.css documents experience and bumped the version to v0.2.x. The new Docs can be viewed at https://picturepan2.github.io/spectre/. Here are the new things added:
-
-
New Docs experience with better navigations and better mobile off-canvas menu
-
New components: Tiles, Steps and Navs (part of Navigation)
-
Improvements: Action button, Autocomplete, Pagination, Tabs, Breadcrumbs, Badges, Cards, new Progress experimental support and better focus style
Spectre.css is a lightweight, responsive and modern CSS framework for faster and extensible development.
+
Spectre provides basic styles for typography and elements, flexbox based responsive layout system, pure CSS components and utilities with best practice coding and consistent design language.
Add the columns class to a container with the container class.
- And add any element you want with the column class 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>.
-
-
And you can add the col-gapless class to the columns to have gapless columns.
By default, Spectre grid has multi-line flexbox enabled. You can add the col-oneline class to columns to make all its child columns positioned in the same single row.
-
-
-
col-8
-
-
-
col-8
-
-
-
<!-- one line columns -->
-<divclass="columns col-oneline">
- <divclass="column col-8">col-8</div>
- <divclass="column col-8">col-8</div>
-</div>
-
- The Flexbox grid provides margin auto utilities to set offset.
- There are col-mx-auto, col-ml-auto and col-mr-auto to set margins between columns without using empty columns.
-
Spectre provides a neat responsive layout grid system and responsive visibility utilities.
-
-
-
col-10 col-lg-8 col-md-6 col-sm-4
-
-
-
col-2 col-lg-4 col-md-6 col-sm-8
-
-
-
There are col-xs-<1-12>, col-sm-<1-12>, col-md-<1-12>, col-lg-<1-12> and col-xl-<1-12> available for flexible grid across mobile, tablet and desktop viewport usage.
-
-
col-xs-<1-12> apply to window width smaller than or equal to 480px.
-
col-sm-<1-12> apply to window width smaller than or equal to 600px.
-
col-md-<1-12> apply to window width smaller than or equal to 840px.
-
col-lg-<1-12> apply to window width smaller than or equal to 960px.
-
col-xl-<1-12> apply to window width smaller than or equal to 1280px.
-
col-<1-12> apply to all window width, including the width wider than 1280px.
- The responsive layout also provides fixed-width containers.
- Use grid-xs(480px), grid-sm(600px), grid-md(840px), grid-lg(960px) or grid-xl(1280px) to the container for a fixed-width container with the specific max-width.
-
-
<!-- 100% width container with max-width set to grid-lg (960px) -->
-<divclass="container grid-lg">
- <divclass="columns">
- ...
- </div>
-</div>
-
- The navbar component can include logo brand, nav links and buttons, search box or any combination of those elements.
- Each section with the navbar-section class will be evenly distributed in the container.
-