├── .gitignore ├── LICENSE.md ├── README.md ├── _components ├── buttons.html ├── buttons_groups.html ├── buttons_sizes.html ├── typography_headings.html └── typography_texts.html ├── _config.yml ├── _includes └── component.html ├── _layouts └── default.html ├── _sass ├── base │ ├── _base.scss │ ├── _syntax-highlighting.scss │ └── _typography.scss ├── components │ └── _buttons.scss ├── layout │ └── _styleguide.scss ├── utils │ └── _helpers.scss └── vendor │ └── _normalize.scss ├── css └── screen.scss └── index.html /.gitignore: -------------------------------------------------------------------------------- 1 | _site 2 | .sass-cache 3 | .DS_Store 4 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Jérôme Coupé 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Simple Jekyll based style guide 2 | 3 | This is a simple style guide generator in [Jekyll](http://jekyllrb.com). It is not particularly original but I tried to make it as flexible as possible to correspond to various use cases. 4 | 5 | - simple list-based style guides ([Code for America style guide](http://codeforamerica.clearleft.com/) by [Clearleft](http://clearleft.com/)) 6 | - more complex style guides using posts or pages ([Lonely Planet "Rizzo" style guide](http://rizzo.lonelyplanet.com/styleguide/design-elements/colours) by [Lonely Planet](http://www.lonelyplanet.com/)) 7 | 8 | I used a custom collection (with output set to false) rather than posts or pages so I can use those to create more complex style guides if needed. 9 | 10 | ## Demo 11 | 12 | Here is what the [default output looks like](http://jeromecoupe.github.io/jekyllstyleguide/). 13 | 14 | ## How it works 15 | 16 | Define components in the `_components` folder. Each component is output twice (code and preview) using a single include file `_includes/component.html`. 17 | 18 | - The `type` variable in components is used to be able to group them (using the `group_by` parameter) or only display a certain type of components (using the `where` parameter) in more complex style guides. 19 | - The `sass` variable is used to reference the sass file for all the CSS rules applied to each component. 20 | - Easy to expand the list of component variables: maybe you need notes or js files. Just update your components YAML front matter and your component include and you're good to go. 21 | 22 | Display components in your templates using simple `{% for %}` loops. 23 | 24 | Simple `{% for %}` loop to display all components (ordered using file names) 25 | 26 | ```liquid 27 | {% assign entries = site.components %} 28 | {% for entry in entries %} 29 | {% include component.html %} 30 | {% endfor %} 31 | ``` 32 | 33 | `{% for %}` loop using `group_by` to display components grouped by type 34 | 35 | ```liquid 36 | {% assign componentsByType = site.components | group_by:"type" %} 37 | {% for type in componentsByType %} 38 |

{{ type.name | capitalize }}

39 | {% for entry in type.items %} 40 | {% include component.html %} 41 | {% endfor %} 42 | {% endfor %} 43 | ``` 44 | 45 | When creating a more detailed style guides using pages, it is useful to be able to display only a certain type of components in your pages using a `where` parameter in your `{% for %}` loop 46 | 47 | ```liquid 48 | {% assign entries = site.components | where:"type","buttons" %} 49 | {% for entry in entries %} 50 | {% include component.html %} 51 | {% endfor %} 52 | ``` 53 | -------------------------------------------------------------------------------- /_components/buttons.html: -------------------------------------------------------------------------------- 1 | --- 2 | title: Buttons 3 | scss: '/_scss/components/buttons.scss' 4 | type: buttons 5 | --- 6 | Button text 7 | 8 | 9 | -------------------------------------------------------------------------------- /_components/buttons_groups.html: -------------------------------------------------------------------------------- 1 | --- 2 | title: Button group 3 | scss: '/_scss/components/buttons.scss' 4 | type: buttons 5 | --- 6 |
7 | Button text 8 | 9 | 10 |
11 | -------------------------------------------------------------------------------- /_components/buttons_sizes.html: -------------------------------------------------------------------------------- 1 | --- 2 | title: button sizes 3 | scss: '/_scss/components/buttons.scss' 4 | type: buttons 5 | --- 6 | Button text 7 | 8 | -------------------------------------------------------------------------------- /_components/typography_headings.html: -------------------------------------------------------------------------------- 1 | --- 2 | title: Headings 3 | scss: '/_scss/base/typography.scss' 4 | type: typography 5 | --- 6 |

This is a level one heading

7 |

This is a level two heading

8 |

This is a level three heading

9 |

This is a level four heading

10 |
This is a level five heading
11 |
This is a level six heading
12 | -------------------------------------------------------------------------------- /_components/typography_texts.html: -------------------------------------------------------------------------------- 1 | --- 2 | title: Texts 3 | scss: '/_scss/base/typography.scss' 4 | type: typography 5 | --- 6 |

Level one title

7 |
8 |

Large text (21px) Lorem ipsum dolor sit amet, consectetur adipisicing elit. Incidunt veritatis sequi nobis earum dicta vero impedit esse at, debitis doloremque eius inventore qui, et dolores eaque eos iste repellendus non.

9 |
10 |

Level two title

11 |

Default text (16px) Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

12 | 17 |

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

18 |
    19 |
  1. list item
  2. 20 |
  3. list item
  4. 21 |
  5. list item
  6. 22 |
23 |

Small text (14px) Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

24 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | # Site settings 2 | title: Style guide template 3 | email: jerome.coupe@webstoemp.com 4 | description: Style guide boilerplate with Jekyll 5 | baseurl: "" 6 | url: "http://www.webstoemp.com/jekyllstyleguide" # the base hostname & protocol for your site 7 | twitter_username: jeromecoupe 8 | github_username: jeromecoupe 9 | 10 | # Collections 11 | collections: 12 | components: 13 | output: false 14 | 15 | # Front Matter Defaults 16 | 17 | # General settings 18 | highlighter: rouge 19 | markdown: kramdown 20 | kramdown: 21 | input: GFM 22 | sass: 23 | sass_dir: _sass 24 | style: :compressed 25 | -------------------------------------------------------------------------------- /_includes/component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |

{{ entry.title }}

5 |

Sass file: {{ entry.scss }}

6 |
7 |
8 |
9 | {{ entry.content }} 10 |
11 |
12 | {% highlight html %} 13 | {{ entry.content }} 14 | {% endhighlight %} 15 |
16 |
17 | 18 |
19 | -------------------------------------------------------------------------------- /_layouts/default.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | {% if page.title %}{{ page.title }} - {% endif %}{{ site.title }} 8 | 9 | 10 | 11 | 12 | 13 | 14 | {{ content }} 15 | 16 | 17 | -------------------------------------------------------------------------------- /_sass/base/_base.scss: -------------------------------------------------------------------------------- 1 | body 2 | { 3 | margin:0; 4 | padding:1em; 5 | background:#fff; 6 | color:#333; 7 | } 8 | -------------------------------------------------------------------------------- /_sass/base/_syntax-highlighting.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Syntax highlighting styles 3 | */ 4 | .highlight { 5 | margin:1em 0; 6 | padding:0 1em; 7 | background: #f6f6f6; 8 | border:1px solid #EEEEEE; 9 | border-radius:.15em; 10 | 11 | .c { color: #998; font-style: italic } // Comment 12 | .err { color: #a61717; background-color: #e3d2d2 } // Error 13 | .k { font-weight: bold } // Keyword 14 | .o { font-weight: bold } // Operator 15 | .cm { color: #998; font-style: italic } // Comment.Multiline 16 | .cp { color: #999; font-weight: bold } // Comment.Preproc 17 | .c1 { color: #998; font-style: italic } // Comment.Single 18 | .cs { color: #999; font-weight: bold; font-style: italic } // Comment.Special 19 | .gd { color: #000; background-color: #fdd } // Generic.Deleted 20 | .gd .x { color: #000; background-color: #faa } // Generic.Deleted.Specific 21 | .ge { font-style: italic } // Generic.Emph 22 | .gr { color: #a00 } // Generic.Error 23 | .gh { color: #999 } // Generic.Heading 24 | .gi { color: #000; background-color: #dfd } // Generic.Inserted 25 | .gi .x { color: #000; background-color: #afa } // Generic.Inserted.Specific 26 | .go { color: #888 } // Generic.Output 27 | .gp { color: #555 } // Generic.Prompt 28 | .gs { font-weight: bold } // Generic.Strong 29 | .gu { color: #aaa } // Generic.Subheading 30 | .gt { color: #a00 } // Generic.Traceback 31 | .kc { font-weight: bold } // Keyword.Constant 32 | .kd { font-weight: bold } // Keyword.Declaration 33 | .kp { font-weight: bold } // Keyword.Pseudo 34 | .kr { font-weight: bold } // Keyword.Reserved 35 | .kt { color: #458; font-weight: bold } // Keyword.Type 36 | .m { color: #099 } // Literal.Number 37 | .s { color: #d14 } // Literal.String 38 | .na { color: #008080 } // Name.Attribute 39 | .nb { color: #0086B3 } // Name.Builtin 40 | .nc { color: #458; font-weight: bold } // Name.Class 41 | .no { color: #008080 } // Name.Constant 42 | .ni { color: #800080 } // Name.Entity 43 | .ne { color: #900; font-weight: bold } // Name.Exception 44 | .nf { color: #900; font-weight: bold } // Name.Function 45 | .nn { color: #555 } // Name.Namespace 46 | .nt { color: #000080 } // Name.Tag 47 | .nv { color: #008080 } // Name.Variable 48 | .ow { font-weight: bold } // Operator.Word 49 | .w { color: #bbb } // Text.Whitespace 50 | .mf { color: #099 } // Literal.Number.Float 51 | .mh { color: #099 } // Literal.Number.Hex 52 | .mi { color: #099 } // Literal.Number.Integer 53 | .mo { color: #099 } // Literal.Number.Oct 54 | .sb { color: #d14 } // Literal.String.Backtick 55 | .sc { color: #d14 } // Literal.String.Char 56 | .sd { color: #d14 } // Literal.String.Doc 57 | .s2 { color: #d14 } // Literal.String.Double 58 | .se { color: #d14 } // Literal.String.Escape 59 | .sh { color: #d14 } // Literal.String.Heredoc 60 | .si { color: #d14 } // Literal.String.Interpol 61 | .sx { color: #d14 } // Literal.String.Other 62 | .sr { color: #009926 } // Literal.String.Regex 63 | .s1 { color: #d14 } // Literal.String.Single 64 | .ss { color: #990073 } // Literal.String.Symbol 65 | .bp { color: #999 } // Name.Builtin.Pseudo 66 | .vc { color: #008080 } // Name.Variable.Class 67 | .vg { color: #008080 } // Name.Variable.Global 68 | .vi { color: #008080 } // Name.Variable.Instance 69 | .il { color: #099 } // Literal.Number.Integer.Long 70 | } 71 | -------------------------------------------------------------------------------- /_sass/base/_typography.scss: -------------------------------------------------------------------------------- 1 | html 2 | { 3 | font:normal 1em/1.5 'Helvetica', 'Arial', sans-serif; 4 | } 5 | 6 | h1,h2,h3,h4,h5,h6, 7 | ul,ol,dd, 8 | p,figure, 9 | table,fieldset,hr 10 | { 11 | margin:0; 12 | margin-bottom:1rem; 13 | } 14 | 15 | /* ----------------------- *\ 16 | =titles 17 | \* ----------------------- */ 18 | 19 | h1, h2, h3, h4, h5, h6 20 | { 21 | font:normal 100%/1.2 'Helvetica', 'Arial', sans-serif; 22 | } 23 | 24 | h1 25 | { 26 | margin-bottom: .5em; 27 | font-size: 2rem; 28 | font-weight: 600; 29 | text-transform: uppercase; 30 | } 31 | 32 | h2 33 | { 34 | margin-bottom: .5em; 35 | font-size: 1.75rem; 36 | } 37 | 38 | h3 39 | { 40 | margin-bottom: .75em; 41 | font-size: 1.65rem; 42 | } 43 | 44 | h4 45 | { 46 | margin-bottom: .75em; 47 | font-size: 1.25rem; 48 | text-transform:uppercase; 49 | } 50 | 51 | h5 52 | { 53 | margin-bottom: .75em; 54 | font-size: 1.25rem; 55 | font-weight: 600; 56 | } 57 | 58 | h6 59 | { 60 | margin-bottom: .75em; 61 | font-size: 1.15rem; 62 | font-weight: 600; 63 | } 64 | 65 | /* ----------------------- *\ 66 | =texts 67 | \* ----------------------- */ 68 | .text-big 69 | { 70 | font-size:1.3125rem; 71 | } 72 | 73 | .text-small 74 | { 75 | font-size:0.875rem; 76 | } 77 | 78 | /* ----------------------- *\ 79 | =lists 80 | \* ----------------------- */ 81 | ol, ul 82 | { 83 | padding:0 0 0 1.5em; 84 | } 85 | -------------------------------------------------------------------------------- /_sass/components/_buttons.scss: -------------------------------------------------------------------------------- 1 | .button 2 | { 3 | display: inline-block; 4 | vertical-align: middle; 5 | margin: 0; 6 | padding: .75em 1em; 7 | border: none; 8 | border-radius: .2em; 9 | cursor: pointer; 10 | background-color: #399FD3; 11 | color: #fff; 12 | text-shadow: 1px 1px 0 rgba(0,0,0,.35); 13 | 14 | font-size: 1rem; 15 | font-weight: 400; 16 | line-height: 1; 17 | text-align: center; 18 | text-decoration: none; 19 | 20 | transition: all 0.15s linear; 21 | 22 | &:hover 23 | { 24 | background-color: mix(#fff, #399FD3, 20%); 25 | } 26 | } 27 | 28 | .button--large 29 | { 30 | font-size: 105%; 31 | } 32 | 33 | .button--small 34 | { 35 | font-size: 95%; 36 | } 37 | 38 | .button-group 39 | { 40 | .button 41 | { 42 | float: left; 43 | border-radius: 0; 44 | } 45 | 46 | .button:first-child 47 | { 48 | border-radius: .2em 0 0 .2em; 49 | border-right: 1px solid mix(#fff, #399FD3, 35%); 50 | } 51 | 52 | .button:last-child 53 | { 54 | border-radius: 0 .2em .2em 0; 55 | border-left: 1px solid mix(#fff, #399FD3, 35%); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /_sass/layout/_styleguide.scss: -------------------------------------------------------------------------------- 1 | .sg-component 2 | { 3 | margin: 2em 0; 4 | border: 1px solid #ececec; 5 | } 6 | 7 | .sg-component__header 8 | { 9 | padding: 1.5em; 10 | background: #f7f7f7; 11 | border-bottom: 1px solid #ececec; 12 | } 13 | 14 | .sg-component__title 15 | { 16 | margin: 0; 17 | padding: 0; 18 | font: 600 0.75rem/1.2 'Helvetica', 'Arial', sans-serif; 19 | text-transform: uppercase; 20 | color: #333; 21 | } 22 | 23 | .sg-component__sass 24 | { 25 | margin: .5em 0 0; 26 | padding: 0; 27 | font: 400 italic 0.75rem/1.2 'Helvetica', 'Arial', sans-serif; 28 | } 29 | 30 | .sg-component__body 31 | { 32 | padding: 1.5em; 33 | } 34 | 35 | .sg-h2 36 | { 37 | font:normal 100%/1.2 'Helvetica', 'Arial', sans-serif; 38 | margin-bottom: 1em; 39 | font-size: 1.75rem; 40 | text-transform:uppercase; 41 | } -------------------------------------------------------------------------------- /_sass/utils/_helpers.scss: -------------------------------------------------------------------------------- 1 | %clearfix, .clearfix 2 | { 3 | &:after 4 | { 5 | content:""; 6 | display:table; 7 | clear:both; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /_sass/vendor/_normalize.scss: -------------------------------------------------------------------------------- 1 | /*! normalize.css v3.0.2 | MIT License | git.io/normalize */ 2 | 3 | /** 4 | * 1. Set default font family to sans-serif. 5 | * 2. Prevent iOS text size adjust after orientation change, without disabling 6 | * user zoom. 7 | */ 8 | 9 | html { 10 | font-family: sans-serif; /* 1 */ 11 | -ms-text-size-adjust: 100%; /* 2 */ 12 | -webkit-text-size-adjust: 100%; /* 2 */ 13 | } 14 | 15 | /** 16 | * Remove default margin. 17 | */ 18 | 19 | body { 20 | margin: 0; 21 | } 22 | 23 | /* HTML5 display definitions 24 | ========================================================================== */ 25 | 26 | /** 27 | * Correct `block` display not defined for any HTML5 element in IE 8/9. 28 | * Correct `block` display not defined for `details` or `summary` in IE 10/11 29 | * and Firefox. 30 | * Correct `block` display not defined for `main` in IE 11. 31 | */ 32 | 33 | article, 34 | aside, 35 | details, 36 | figcaption, 37 | figure, 38 | footer, 39 | header, 40 | hgroup, 41 | main, 42 | menu, 43 | nav, 44 | section, 45 | summary { 46 | display: block; 47 | } 48 | 49 | /** 50 | * 1. Correct `inline-block` display not defined in IE 8/9. 51 | * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. 52 | */ 53 | 54 | audio, 55 | canvas, 56 | progress, 57 | video { 58 | display: inline-block; /* 1 */ 59 | vertical-align: baseline; /* 2 */ 60 | } 61 | 62 | /** 63 | * Prevent modern browsers from displaying `audio` without controls. 64 | * Remove excess height in iOS 5 devices. 65 | */ 66 | 67 | audio:not([controls]) { 68 | display: none; 69 | height: 0; 70 | } 71 | 72 | /** 73 | * Address `[hidden]` styling not present in IE 8/9/10. 74 | * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22. 75 | */ 76 | 77 | [hidden], 78 | template { 79 | display: none; 80 | } 81 | 82 | /* Links 83 | ========================================================================== */ 84 | 85 | /** 86 | * Remove the gray background color from active links in IE 10. 87 | */ 88 | 89 | a { 90 | background-color: transparent; 91 | } 92 | 93 | /** 94 | * Improve readability when focused and also mouse hovered in all browsers. 95 | */ 96 | 97 | a:active, 98 | a:hover { 99 | outline: 0; 100 | } 101 | 102 | /* Text-level semantics 103 | ========================================================================== */ 104 | 105 | /** 106 | * Address styling not present in IE 8/9/10/11, Safari, and Chrome. 107 | */ 108 | 109 | abbr[title] { 110 | border-bottom: 1px dotted; 111 | } 112 | 113 | /** 114 | * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. 115 | */ 116 | 117 | b, 118 | strong { 119 | font-weight: bold; 120 | } 121 | 122 | /** 123 | * Address styling not present in Safari and Chrome. 124 | */ 125 | 126 | dfn { 127 | font-style: italic; 128 | } 129 | 130 | /** 131 | * Address variable `h1` font-size and margin within `section` and `article` 132 | * contexts in Firefox 4+, Safari, and Chrome. 133 | */ 134 | 135 | h1 { 136 | font-size: 2em; 137 | margin: 0.67em 0; 138 | } 139 | 140 | /** 141 | * Address styling not present in IE 8/9. 142 | */ 143 | 144 | mark { 145 | background: #ff0; 146 | color: #000; 147 | } 148 | 149 | /** 150 | * Address inconsistent and variable font size in all browsers. 151 | */ 152 | 153 | small { 154 | font-size: 80%; 155 | } 156 | 157 | /** 158 | * Prevent `sub` and `sup` affecting `line-height` in all browsers. 159 | */ 160 | 161 | sub, 162 | sup { 163 | font-size: 75%; 164 | line-height: 0; 165 | position: relative; 166 | vertical-align: baseline; 167 | } 168 | 169 | sup { 170 | top: -0.5em; 171 | } 172 | 173 | sub { 174 | bottom: -0.25em; 175 | } 176 | 177 | /* Embedded content 178 | ========================================================================== */ 179 | 180 | /** 181 | * Remove border when inside `a` element in IE 8/9/10. 182 | */ 183 | 184 | img { 185 | border: 0; 186 | } 187 | 188 | /** 189 | * Correct overflow not hidden in IE 9/10/11. 190 | */ 191 | 192 | svg:not(:root) { 193 | overflow: hidden; 194 | } 195 | 196 | /* Grouping content 197 | ========================================================================== */ 198 | 199 | /** 200 | * Address margin not present in IE 8/9 and Safari. 201 | */ 202 | 203 | figure { 204 | margin: 1em 40px; 205 | } 206 | 207 | /** 208 | * Address differences between Firefox and other browsers. 209 | */ 210 | 211 | hr { 212 | -moz-box-sizing: content-box; 213 | box-sizing: content-box; 214 | height: 0; 215 | } 216 | 217 | /** 218 | * Contain overflow in all browsers. 219 | */ 220 | 221 | pre { 222 | overflow: auto; 223 | } 224 | 225 | /** 226 | * Address odd `em`-unit font size rendering in all browsers. 227 | */ 228 | 229 | code, 230 | kbd, 231 | pre, 232 | samp { 233 | font-family: monospace, monospace; 234 | font-size: 1em; 235 | } 236 | 237 | /* Forms 238 | ========================================================================== */ 239 | 240 | /** 241 | * Known limitation: by default, Chrome and Safari on OS X allow very limited 242 | * styling of `select`, unless a `border` property is set. 243 | */ 244 | 245 | /** 246 | * 1. Correct color not being inherited. 247 | * Known issue: affects color of disabled elements. 248 | * 2. Correct font properties not being inherited. 249 | * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. 250 | */ 251 | 252 | button, 253 | input, 254 | optgroup, 255 | select, 256 | textarea { 257 | color: inherit; /* 1 */ 258 | font: inherit; /* 2 */ 259 | margin: 0; /* 3 */ 260 | } 261 | 262 | /** 263 | * Address `overflow` set to `hidden` in IE 8/9/10/11. 264 | */ 265 | 266 | button { 267 | overflow: visible; 268 | } 269 | 270 | /** 271 | * Address inconsistent `text-transform` inheritance for `button` and `select`. 272 | * All other form control elements do not inherit `text-transform` values. 273 | * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. 274 | * Correct `select` style inheritance in Firefox. 275 | */ 276 | 277 | button, 278 | select { 279 | text-transform: none; 280 | } 281 | 282 | /** 283 | * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` 284 | * and `video` controls. 285 | * 2. Correct inability to style clickable `input` types in iOS. 286 | * 3. Improve usability and consistency of cursor style between image-type 287 | * `input` and others. 288 | */ 289 | 290 | button, 291 | html input[type="button"], /* 1 */ 292 | input[type="reset"], 293 | input[type="submit"] { 294 | -webkit-appearance: button; /* 2 */ 295 | cursor: pointer; /* 3 */ 296 | } 297 | 298 | /** 299 | * Re-set default cursor for disabled elements. 300 | */ 301 | 302 | button[disabled], 303 | html input[disabled] { 304 | cursor: default; 305 | } 306 | 307 | /** 308 | * Remove inner padding and border in Firefox 4+. 309 | */ 310 | 311 | button::-moz-focus-inner, 312 | input::-moz-focus-inner { 313 | border: 0; 314 | padding: 0; 315 | } 316 | 317 | /** 318 | * Address Firefox 4+ setting `line-height` on `input` using `!important` in 319 | * the UA stylesheet. 320 | */ 321 | 322 | input { 323 | line-height: normal; 324 | } 325 | 326 | /** 327 | * It's recommended that you don't attempt to style these elements. 328 | * Firefox's implementation doesn't respect box-sizing, padding, or width. 329 | * 330 | * 1. Address box sizing set to `content-box` in IE 8/9/10. 331 | * 2. Remove excess padding in IE 8/9/10. 332 | */ 333 | 334 | input[type="checkbox"], 335 | input[type="radio"] { 336 | box-sizing: border-box; /* 1 */ 337 | padding: 0; /* 2 */ 338 | } 339 | 340 | /** 341 | * Fix the cursor style for Chrome's increment/decrement buttons. For certain 342 | * `font-size` values of the `input`, it causes the cursor style of the 343 | * decrement button to change from `default` to `text`. 344 | */ 345 | 346 | input[type="number"]::-webkit-inner-spin-button, 347 | input[type="number"]::-webkit-outer-spin-button { 348 | height: auto; 349 | } 350 | 351 | /** 352 | * 1. Address `appearance` set to `searchfield` in Safari and Chrome. 353 | * 2. Address `box-sizing` set to `border-box` in Safari and Chrome 354 | * (include `-moz` to future-proof). 355 | */ 356 | 357 | input[type="search"] { 358 | -webkit-appearance: textfield; /* 1 */ 359 | -moz-box-sizing: content-box; 360 | -webkit-box-sizing: content-box; /* 2 */ 361 | box-sizing: content-box; 362 | } 363 | 364 | /** 365 | * Remove inner padding and search cancel button in Safari and Chrome on OS X. 366 | * Safari (but not Chrome) clips the cancel button when the search input has 367 | * padding (and `textfield` appearance). 368 | */ 369 | 370 | input[type="search"]::-webkit-search-cancel-button, 371 | input[type="search"]::-webkit-search-decoration { 372 | -webkit-appearance: none; 373 | } 374 | 375 | /** 376 | * Define consistent border, margin, and padding. 377 | */ 378 | 379 | fieldset { 380 | border: 1px solid #c0c0c0; 381 | margin: 0 2px; 382 | padding: 0.35em 0.625em 0.75em; 383 | } 384 | 385 | /** 386 | * 1. Correct `color` not being inherited in IE 8/9/10/11. 387 | * 2. Remove padding so people aren't caught out if they zero out fieldsets. 388 | */ 389 | 390 | legend { 391 | border: 0; /* 1 */ 392 | padding: 0; /* 2 */ 393 | } 394 | 395 | /** 396 | * Remove default vertical scrollbar in IE 8/9/10/11. 397 | */ 398 | 399 | textarea { 400 | overflow: auto; 401 | } 402 | 403 | /** 404 | * Don't inherit the `font-weight` (applied by a rule above). 405 | * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. 406 | */ 407 | 408 | optgroup { 409 | font-weight: bold; 410 | } 411 | 412 | /* Tables 413 | ========================================================================== */ 414 | 415 | /** 416 | * Remove most spacing between table cells. 417 | */ 418 | 419 | table { 420 | border-collapse: collapse; 421 | border-spacing: 0; 422 | } 423 | 424 | td, 425 | th { 426 | padding: 0; 427 | } 428 | -------------------------------------------------------------------------------- /css/screen.scss: -------------------------------------------------------------------------------- 1 | --- 2 | --- 3 | @import 'vendor/normalize'; 4 | 5 | @import 'base/base'; 6 | @import 'base/typography'; 7 | @import 'base/syntax-highlighting'; 8 | 9 | @import 'layout/styleguide'; 10 | 11 | @import 'components/buttons'; 12 | 13 | @import 'utils/helpers'; 14 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 |

Styleguide Template

6 | 7 |

Boilerplate for creating components based style guides using Jekyll. Here is the Github repository for it, should you want to have a peek at the code, fork it or report an issue.

8 | 9 | {% assign entries = site.components %} 10 | {% for entry in entries %} 11 | {% include component.html %} 12 | {% endfor %} 13 | 14 | {% comment %} 15 | 16 | If you want to make sure your types are grouped (file names are not enough), you could use this group_by loop instead 17 | 18 | {% assign componentsByType = site.components | group_by:"type" %} 19 | {% for type in componentsByType %} 20 |

{{ type.name | capitalize }}

21 | {% for entry in type.items %} 22 | {% include component.html %} 23 | {% endfor %} 24 | {% endfor %} 25 | 26 | {% endcomment %} 27 | 28 | 29 | 30 | {% comment %} 31 | 32 | If you want to use pages and/or posts to create a more comple styleguide with pages / intros for every type of components, you can use these where loops on those pages / posts instead 33 | 34 | {% assign entries = site.components | where:"type","buttons" %} 35 | {% for entry in entries %} 36 | {% include component.html %} 37 | {% endfor %} 38 | 39 | {% assign entries = site.components | where:"type","typography" %} 40 | {% for entry in entries %} 41 | {% include component.html %} 42 | {% endfor %} 43 | 44 | {% endcomment %} 45 | --------------------------------------------------------------------------------