diff options
update typography style
13 files changed, 574 insertions, 10 deletions
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | demo/index.html | 55 | ||||
| -rw-r--r-- | dist/spectre.css | 244 | ||||
| -rw-r--r-- | spectre.less | 27 | ||||
| -rw-r--r-- | src/base.less | 9 | ||||
| -rw-r--r-- | src/buttons.less | 1 | ||||
| -rw-r--r-- | src/dist/layout.css | 1 | ||||
| -rw-r--r-- | src/dist/type.css | 1 | ||||
| -rw-r--r-- | src/layout.less | 1 | ||||
| -rw-r--r-- | src/normalize.less | 23 | ||||
| -rw-r--r-- | src/typography.less | 112 | ||||
| -rw-r--r-- | src/utilities.less | 102 | ||||
| -rw-r--r-- | src/variables.less | 6 |
@@ -1,4 +1,4 @@ -# spectre +# Spectre Spectre, a lightweight and clean CSS framework for faster and extendable development. * lightweight and clean starting point for your project diff --git a/demo/index.html b/demo/index.html new file mode 100644 index 0000000..77480e7 --- /dev/null +++ b/demo/index.html @@ -0,0 +1,55 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <title>Spectre, a lightweight and clean CSS framework for faster and extendable development.</title> + <link rel="stylesheet" href="../dist/spectre.css"> +</head> +<body> + <section class="container"> + <section class="typography"> + <header class="text-center">headings</header> + <h1>H1 Title</h1> + <h2>H2 Title</h2> + <h3>H3 Title</h3> + <h4>H4 Title</h4> + <h5>H5 Title</h5> + <h6>H6 Title</h6> + + <header class="text-center">paragraphs</header> + <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> + <p class="lead">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> + + <header class="text-center">blockquote</header> + <blockquote> + <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> + <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> + </blockquote> + + <header class="text-center">lists</header> + <ul class="list"> + <li>list item 1</li> + <li>list item 2 + <ul> + <li>list item 2.1</li> + <li>list item 2.2</li> + <li>list item 2.3</li> + </ul> + </li> + <li>list item 3</li> + </ul> + <ol class="list"> + <li>list item 1</li> + <li>list item 2 + <ol> + <li>list item 2.1</li> + <li>list item 2.2</li> + <li>list item 2.3</li> + </ol> + </li> + <li>list item 3</li> + </ol> + </section> + </section> +</body> +</html>
\ No newline at end of file diff --git a/dist/spectre.css b/dist/spectre.css index 184977c..4d096e3 100644 --- a/dist/spectre.css +++ b/dist/spectre.css @@ -1,3 +1,8 @@ +/* Copyright 2016 Spectre.css */ +/* Core variables */ +/* Core variables */ +/* Global */ +/* Reset and dependencies */ /*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */ /** * 1. Set default font family to sans-serif. @@ -353,6 +358,27 @@ td, th { padding: 0; } +input, +button, +select, +textarea { + font-family: inherit; + font-size: inherit; + line-height: inherit; +} +ul, +ol { + list-style: none; + padding: 0; + margin: 0; +} +ul ul, +ol ul, +ul ol, +ol ol { + margin-bottom: 0; +} +/* Base */ * { box-sizing: border-box; } @@ -360,7 +386,223 @@ th { *:after { box-sizing: border-box; } +html { + font-size: 10px; +} body { + color: #333; + font-family: "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", WenQuanYi Micro Hei, sans-serif; + font-size: 14px; background-color: #fff; - font-size: "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", WenQuanYi Micro Hei, sans-serif; +} +/* Core classes */ +/* Typography */ +h1, +h2, +h3, +h4, +h5, +h6 { + font-weight: 300; +} +h1 { + font-size: 5rem; +} +h2 { + font-size: 4rem; +} +h3 { + font-size: 3rem; +} +h4 { + font-size: 2.4rem; +} +h5 { + font-size: 2rem; +} +h6 { + font-size: 1.6rem; +} +p { + line-height: 1.428571429; + margin: 0 0 1rem; +} +p.lead { + font-size: 120%; +} +blockquote { + padding: 1rem 2rem; + border-left: 2px solid #ddd; +} +blockquote p:last-child { + margin-bottom: 0; +} +.text-left { + text-align: left; +} +.text-right { + text-align: right; +} +.text-center { + text-align: center; +} +.text-justify { + text-align: justify; +} +.text-lowercase { + text-transform: lowercase; +} +.text-uppercase { + text-transform: uppercase; +} +.text-capitalize { + text-transform: capitalize; +} +.text-bold { + font-weight: bold; +} +.text-italic { + font-style: italic; +} +.text-ellipsis { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.text-clip { + white-space: nowrap; + overflow: hidden; + text-overflow: clip; +} +.text-break { + word-break: break-word; + word-wrap: break-word; + -webkit-hyphens: auto; + -moz-hyphens: auto; + -ms-hyphens: auto; + hyphens: auto; +} +/* List */ +ul, +ol { + margin: 0 0 1rem; +} +ul ul, +ol ul, +ul ol, +ol ol { + margin-left: 2rem; +} +ul { + list-style: disc inside; +} +ul ul { + list-style-type: circle; +} +ol { + list-style: decimal inside; +} +ol ol { + list-style-type: lower-alpha; +} +/* Layout */ +/* Components */ +/* Buttons */ +/* Utility classes */ +/* Position */ +.clearfix:before, +.clearfix:after { + content: " "; + display: table; +} +.clearfix:after { + clear: both; +} +.pull-left { + float: left !important; +} +.pull-right { + float: right !important; +} +.rel { + position: relative; +} +.abs { + position: absolute; +} +.fixed { + position: fixed; +} +.top { + position: absolute; + top: 0; +} +.right { + position: absolute; + right: 0; +} +.bottom { + position: absolute; + bottom: 0; +} +.left { + position: absolute; + left: 0; +} +.mt-10 { + margin-top: 10px; +} +.mr-10 { + margin-right: 10px; +} +.mb-10 { + margin-bottom: 10px; +} +.ml-10 { + margin-left: 10px; +} +.mt-5 { + margin-top: 5px; +} +.mr-5 { + margin-right: 5px; +} +.mb-5 { + margin-bottom: 5px; +} +.ml-5 { + margin-left: 5px; +} +/* Display */ +.block { + display: block !important; +} +.inline { + display: inline !important; +} +.inline-block { + display: inline-block !important; +} +.flex { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; +} +.hide { + display: none !important; +} +/* Shadow */ +.shadow { + box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); +} +.light-shadow { + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15); +} +/* Shapes */ +.rounded { + border-radius: 3px; +} +.circle { + border-radius: 50%; } diff --git a/spectre.less b/spectre.less index 011bf8b..0454c5e 100644 --- a/spectre.less +++ b/spectre.less @@ -1,8 +1,27 @@ -// Copyright 2016 Spectre.css +/* Copyright 2016 Spectre.css */ -// Core variables +/* Core variables */ @import 'src/variables.less'; -// Reset and dependencies +/* Reset and dependencies */ @import 'src/normalize.less'; -@import 'src/base.less';
\ No newline at end of file +@import 'src/base.less'; + +/* Core classes */ +@import 'src/typography.less'; +@import 'src/layout.less'; + +/* Components */ +@import 'src/buttons.less'; +//@import 'src/inputs.less'; +//@import 'src/forms.less'; +//@import 'src/labels.less'; +//@import 'src/cards.less'; +//@import 'src/menus.less'; +//@import 'src/modals.less'; +//@import 'src/toasts.less'; +//@import 'src/tooltips.less'; +//@import 'src/animations.less'; + +/* Utility classes */ +@import 'src/utilities.less';
\ No newline at end of file diff --git a/src/base.less b/src/base.less index 7e0005c..06e46dd 100644 --- a/src/base.less +++ b/src/base.less @@ -1,4 +1,4 @@ -// Base +/* Base */ * { box-sizing: border-box; } @@ -6,7 +6,12 @@ *:after { box-sizing: border-box; } +html { + font-size: 10px; +} body { + color: @body-font-color; + font-family: @body-font-family; + font-size: @body-font-size; background-color: @body-bg; - font-size: @body-font-family; } diff --git a/src/buttons.less b/src/buttons.less new file mode 100644 index 0000000..2175666 --- /dev/null +++ b/src/buttons.less @@ -0,0 +1 @@ +/* Buttons */
\ No newline at end of file diff --git a/src/dist/layout.css b/src/dist/layout.css new file mode 100644 index 0000000..428cfa1 --- /dev/null +++ b/src/dist/layout.css @@ -0,0 +1 @@ +/* Layout */ diff --git a/src/dist/type.css b/src/dist/type.css new file mode 100644 index 0000000..d7bacdf --- /dev/null +++ b/src/dist/type.css @@ -0,0 +1 @@ +/* Type */ diff --git a/src/layout.less b/src/layout.less new file mode 100644 index 0000000..428cfa1 --- /dev/null +++ b/src/layout.less @@ -0,0 +1 @@ +/* Layout */ diff --git a/src/normalize.less b/src/normalize.less index 3bd3b62..7c6577e 100644 --- a/src/normalize.less +++ b/src/normalize.less @@ -421,4 +421,27 @@ table { td, th { padding: 0; +} + +// Reset fonts for relevant elements +input, +button, +select, +textarea { + font-family: inherit; + font-size: inherit; + line-height: inherit; +} + +ul, +ol { + list-style: none; + padding: 0; + margin: 0; +} +ul ul, +ol ul, +ul ol, +ol ol { + margin-bottom: 0; }
\ No newline at end of file diff --git a/src/typography.less b/src/typography.less new file mode 100644 index 0000000..4c7ee81 --- /dev/null +++ b/src/typography.less @@ -0,0 +1,112 @@ +/* Typography */ +h1, +h2, +h3, +h4, +h5, +h6 { + font-weight: 300; +} +h1 { + font-size: 5rem; +} +h2 { + font-size: 4rem; +} +h3 { + font-size: 3rem; +} +h4 { + font-size: 2.4rem; +} +h5 { + font-size: 2rem; +} +h6 { + font-size: 1.6rem; +} +p { + line-height: 1.428571429; + margin: 0 0 1rem; + + &.lead { + font-size: 120%; + } +} +blockquote { + padding: 1rem 2rem; + border-left: 2px solid #ddd; + + p:last-child { + margin-bottom: 0; + } +} + +.text-left { + text-align: left; +} +.text-right { + text-align: right; +} +.text-center { + text-align: center; +} +.text-justify { + text-align: justify; +} + +.text-lowercase { + text-transform: lowercase; +} +.text-uppercase { + text-transform: uppercase; +} +.text-capitalize { + text-transform: capitalize; +} + +.text-bold { + font-weight: bold; +} +.text-italic { + font-style: italic; +} + +.text-ellipsis { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.text-clip { + white-space: nowrap; + overflow: hidden; + text-overflow: clip; +} +.text-break { + word-break: break-word; + word-wrap: break-word; + hyphens: auto; +} +/* List */ +ul, +ol { + ul, + ol { + margin-left: 2rem; + } + margin: 0 0 1rem; +} +ul { + list-style: disc inside; + + ul { + list-style-type: circle; + } +} +ol { + list-style: decimal inside; + + ol { + list-style-type: lower-alpha; + } +}
\ No newline at end of file diff --git a/src/utilities.less b/src/utilities.less new file mode 100644 index 0000000..775fe58 --- /dev/null +++ b/src/utilities.less @@ -0,0 +1,102 @@ +/* Position */ +.clearfix { + &:before, + &:after { + content: " "; // 1 + display: table; // 2 + } + &:after { + clear: both; + } +} +.pull-left { + float: left !important; +} +.pull-right { + float: right !important; +} + +.rel { + position: relative; +} +.abs { + position: absolute; +} +.fixed { + position: fixed; +} +.top { + .abs; + top: 0; +} +.right { + .abs; + right: 0; +} +.bottom { + .abs; + bottom: 0; +} +.left { + .abs; + left: 0; +} + +.mt-10 { + margin-top: 10px; +} +.mr-10 { + margin-right: 10px; +} +.mb-10 { + margin-bottom: 10px; +} +.ml-10 { + margin-left: 10px; +} + +.mt-5 { + margin-top: 5px; +} +.mr-5 { + margin-right: 5px; +} +.mb-5 { + margin-bottom: 5px; +} +.ml-5 { + margin-left: 5px; +} + +/* Display */ +.block { + display: block !important; +} +.inline { + display: inline !important; +} +.inline-block { + display: inline-block !important; +} +.flex { + display: flex; +} +.hide { + display: none !important; +} + +/* Shadow */ +.shadow { + box-shadow: 0 1px 4px rgba(0, 0, 0, .3); +} +.light-shadow { + box-shadow: 0 1px 2px rgba(0, 0, 0, .15); +} + +/* Shapes */ +.rounded { + border-radius: 3px; +} +.circle { + border-radius: 50%; +}
\ No newline at end of file diff --git a/src/variables.less b/src/variables.less index 98567e4..e31a594 100644 --- a/src/variables.less +++ b/src/variables.less @@ -1,5 +1,7 @@ -// Core variables +/* Core variables */ -// Global +/* Global */ @body-bg: #fff; +@body-font-color: #333; +@body-font-size: 14px; @body-font-family: "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", WenQuanYi Micro Hei, sans-serif;
\ No newline at end of file |