⚡️🎨 A starting point for crafting living style guides.

Overview

Style-Guide-Boilerplate v3.3.2

A starting point for crafting living style guides.

View Demo

Note: Sample patterns have been included in the demo. Your site will have its own unique patterns.

Screenshot

Getting Started With Style Guide Boilerplate

Download the Style Guide Boilerplate

You can clone, fork, or download the repo from GitHub. Once you have the files for Style Guide Boilerplate, you'll create a directory on your site for them.

Set up a directory on your site for the style guide

I recommend creating a directory named style-guide in your site's root directory.

Upload the Style Guide Boilerplate files

Style Guide Boilerplate is currently PHP based so you will need a server that supports PHP. Upload the files from the GitHub repo to your newly created directory.

Hook up your own CSS into the style guide

In the <head> of Style Guide Boilerplate are custom styles for the boilerplate itself. These have all been prefixed with sg- so they hopefully shouldn't cause any conflicts with your website's own styles.

Below the custom styles for the boilerplate, you will add in your own custom stylesheet(s) which you use on your live site.

<!-- Style Guide Boilerplate Styles -->
<link rel="stylesheet" href="css/sg-style.css">

<!-- Replace below stylesheet with your own stylesheet -->
<link rel="stylesheet" href="css/style.css">

Review your live site CSS

You should be able to go to yoursite.com/style-guide/ and see how your live site's CSS affects base elements. The last step is creating your site's custom patterns/modules.

Create custom patterns

To create custom patterns like buttons, breadcrumbs, alert messages, etc., create a new .html file and add your HTML markup into the file.

Save the file as pattern-name.html into the markup/patterns directory inside of your style-guide directory.

You should now be able to see the new patterns at yoursite.com/style-guide/

Create personalized documentation

You can use markdown or html to create personalized documentation for your examples. Create a new .md or .html file and name it whatever your markup snippet file is named.

Save the file as markup-name.md or markup-name.html into the doc/base or doc/patterns directory inside of your style-guide directory.

For example, if you want to create doc for markup/patterns/breadcrumbs.html, create a file called breadcrumbs.md or breadcrumbs.html and save it into doc/patterns.

You should now be able to see the new doc at yoursite.com/style-guide/

Running the app

You can run the application with PHP's built in web server. Run the following command:

php -S localhost:8000

Now, browse to http://localhost:8000 to see the website.

Generating static HTML style guide

You can generate a static index.html version of style guide boilerplate by running the following command:

php index.php > index.html

Browser Support

I've built Style Guide Boilerplate with progressive enhancement in mind to work on a wide range of browsers.

Known supported browsers include:

  • Chrome
  • Firefox
  • Safari
  • Opera
  • IE8+
  • Safari for iOS
  • Stock Android Browser (4.0+)

Tested with BrowserStack.

BrowserStack

If you come across any bugs, or have any other issues with the boilerplate, please open an issue here on GitHub.

Additional Resources

Styleguides.io

Front-end Style Guides

Front-end Style Guide Roundup

Future-Friendly Style Guides

HTML KickStart

Oli.jp Style Guide

Jeremy Keith's Pattern Primer

Paul Robert Llyod's Style Guide

Pears

Starbucks Style Guide

Credit

Thanks to:

Jeremy Keith for letting me build on top of Pattern Primer.

Ports

Contributing to this project

Please take a moment to review the guidelines for contributing.

Licensing

Style Guide Boilerplate is licensed under the MIT License

Comments
  • Static Site Generation

    Static Site Generation

    Hey I love this generator. It's my favorite so far due to its simplicity and versatility. One thing that would be great is to generate a static site from the PHP that could more easily be handed off to customers. Is something like that possible?

    opened by cpoteet 7
  • Markdown processor?

    Markdown processor?

    Hi, thanks for the tool. IMO, this is more flexible than other tools which bake in the documentation inside of the CSS, which I personally dislike. However, is there anyway we can include a markdown processor for the docs? As the docs require code blocks? I'd be happy to send a PR but I haven't worked in PHP before

    opened by vinayraghu 7
  • Code Selection stopped working at some point

    Code Selection stopped working at some point

    I've been trying to build a styleguide using this brilliant work.

    But at some point selection of the code stopped working.

    Firefox with Web Developer addon wont show an error when clicking Copy Source button.

    Would you advise where to move on?

    The live page/patient - https://englishextra.github.io/pages/styleguide.html The Repo here https://github.com/englishextra/englishextra.github.io/blob/master/pages/styleguide.html

    After a couple of hours debugging I found that your original template html markup gets selected visually.

    Mine doesn't - the w3c validator only warns about new functionality but the rest is ok.

    opened by englishextra 6
  • Sanitized URLs

    Sanitized URLs

    I don't know enough about php to answer this myself, so might not even be an issue, but thought I'd check. I noticed that A List Apart seems to be using your boilerplate for the basis of their style guide and they have posted about URL sanitation and potential security risk when the files are public. http://alistapart.com/blog/post/pattern-library-security-vulnerability

    I have used the boilerplate publicly so just checking. Regardless, thanks for the great resource.

    bug question 
    opened by lostsatellites 4
  • sg-nav-group link styles

    sg-nav-group link styles

    css/sg-styles.css only defines .sg-nav-group a and .sg-nav-group a:hover. If a user replaces css/styles.css with a project stylesheet that defines a:visited and a:focus, this might look strange.

    screenshot 2015-12-16 13 44 02

    Probably the easiest solution would be to amend css/sg-style.css like this:

    .sg-nav-group a,
    .sg-nav-group a:visited { … }
    
    .sg-nav-group a:hover,
    .sg-nav-group a:focus { … }
    
    opened by yellowled 3
  • scandir picks up hidden system files

    scandir picks up hidden system files

    Most Unix-/Linux-type operating systems (including OS X) produce hidden system files usually starting with a dot in the file's name (e.g. the infamous .DS_Store on OS X). PHP's scandir picks these up as well, but they are not excluded by if ($file != '.' && $file != '..') in functions.php.

    Ideally, the *FilesInFolder functions should probably exclude any file name that starts with a ..

    opened by yellowled 3
  • Automatic structuring feature

    Automatic structuring feature

    This feature allows quickly add new sections into project, no more index.php manual edit required. Just create a new folders/subfolders into the markup/ directory, and they will be added into project automatically.

    opened by mixedrays 3
  • view source window

    view source window

    If the source is too long, the view source window does not show it all and makes it impossible to view/select/copy. Scrollbar on this window? Possibly a button to copy source?

    bug 
    opened by cramdesign 3
  • Styled Scrollbars

    Styled Scrollbars

    I don't know if you have a reason for this, but it seems unusual to include custom scrollbars in a boilerplate. I suggest you consider removing those styles.

    question 
    opened by jamiebuilds 3
  • Support for box-sizing: border-box?

    Support for box-sizing: border-box?

    Adding a stylesheet that uses box-sizing: border-box makes the color swatches smaller and breaks the hover effect.

    Is it better to assume the use of box-sizing: border-box, or not?

    opened by zgreen 2
  • Layout Guide

    Layout Guide

    In style guides you typically see different layout pages, so I think it would be a good idea to include a link to another page with a super simple demo layout

    enhancement 
    opened by jamiebuilds 2
  • Look into supporting design tokens

    Look into supporting design tokens

    https://github.com/salesforce-ux/theo https://github.com/salesforce-ux/theo-example https://medium.com/@didoo/how-to-manage-your-design-tokens-with-style-dictionary-98c795b938aa https://uxdesign.cc/design-tokens-for-dummies-8acebf010d71 https://24ways.org/2019/design-tokens-and-component-based-design/ https://www.smashingmagazine.com/2019/11/smashing-podcast-episode-3/ https://noti.st/sturobson/QIaw2X

    opened by bjankord 1
  • v4 Rewrite ⚡

    v4 Rewrite ⚡

    Goals of v4 Rewrite

    • Write in language I use day to day so it is easier to maintain
      • I don't use PHP, haven't used it for years. However, I do use NodeJS so the rewrite will be built with that.
      • This will make it much easier for me to add new features
        • Im thinking about adding browser reload on save functionality
        • See if I can incorporate a simple search feature
        • Add support to design tokens for color and fonts
    • Keep it as passive as possible for existing users.
      • Migration should be easy, there will be minimal lift and shift of files required
    • Keep it as simple as possible
      • One of the main goals of the project has been to keep SGB simple, un-opinionated, and easy to use.
      • No jQuery, no Webpack, no Babel. All those tools are useful and have a place, but for this project I want to keep things really easy for people who primarily work in HTML and CSS to get a styleguide up and running.

    What will happen to the PHP version?

    The PHP version will be migrated over to https://github.com/bjankord/Style-Guide-Boilerplate-php

    opened by bjankord 0
Releases(v3.3.2)
  • v3.3.2(Oct 6, 2018)

  • v3.3.1(Oct 6, 2018)

  • v3.3.0(Oct 6, 2018)

  • v3.2.0(Oct 3, 2015)

    • Added markdown support for docs
    • Added markdown styling via github-markdown.css
    • Increased .sg-h2 and .sg-h3 font size to better align with github markdown heading sizes
    • Converted sample documentation .html files to .md files
    • Removed "Usage" heading that appeared above docs
    Source code(tar.gz)
    Source code(zip)
  • v3.1.0(Jul 28, 2015)

    • Updated CONTRIBUTING.md broken link fix (#25, @mixedrays)
    • Added automatic project structuring based on markup/ directory (#25, @mixedrays)
      • Updated functions.php, index.php, sg-scripts.js, and sg-styles.css (#25, @mixedrays)
    Source code(tar.gz)
    Source code(zip)
  • v3.0.0(Jun 17, 2015)

    • Added 'no-js' class to HTML element to help with progressive enhancement
    • Added meta theme-color tag
    • Added minor accessibility improvements
    • Added picture element to media.html example file
    • Changed nav toggle element to button
    • Changed "View Source" and "Copy Source" actions to button elements
    • Cleaned up spacing and comment wording in functions.php
    • Cleaned up sg-scripts.js
    • Cleaned up sg-style.css
    • Removed global form navigation
    • Removed example of fieldset with large amount of text
    • Removed code-prettify (prettyprint) styles
    • Reworked listMarkupAsOptions function into listMarkupAsListItems function
    • Reworked layout template and styles to be more responsive
    • Updated README.md
    • Updated media query breakpoints
    • Updated wording in "Getting Started" section
    • Updated meta viewport tag
    • Updated font stack markup and styling
    • Updated color swatch markup and styling
    • Updated JavaScript syntax highlighter to prism.js
    Source code(tar.gz)
    Source code(zip)
  • v2.6.1(Mar 27, 2015)

    • Improved accessibility of form, media, and table markup examples
    • Added skip to main content link
    • Added .sg-visually-hidden and .sg-visually-hidden-focusable to style text intended for screen readers
    Source code(tar.gz)
    Source code(zip)
  • v2.6.0(Dec 18, 2014)

    • Moved functions in index.php to functions.php
    • Changed Base Styles wording to Base HTML
    • Changed Pattern Styles wording to Patterns
    • Added lang attribute
    Source code(tar.gz)
    Source code(zip)
  • v2.5.2(Dec 17, 2014)

  • v2.5.1(Apr 18, 2014)

  • v2.5.0(Apr 18, 2014)

  • v2.4.0(Apr 18, 2014)

  • v2.3.0(Apr 18, 2014)

  • v2.2.0(Apr 18, 2014)

  • v2.1.0(Apr 18, 2014)

  • v2.0.2(Apr 18, 2014)

  • v2.0.1(Apr 18, 2014)

  • v2.0.0(Apr 18, 2014)

    • Reworked navigation
    • Reworked layout
    • Added hex values to color swatches
    • Added ability to toggle code snippets
    • Switched to placehold.it for images
    • Switched to prettify.js for code highlighting
    • Improved usability across mobile and legacy browsers
    • Normalized time element formatting
    Source code(tar.gz)
    Source code(zip)
  • v1.9.0(Apr 18, 2014)

  • v1.8.1(Apr 18, 2014)

  • v1.8.0(Apr 18, 2014)

  • v1.7.1(Apr 18, 2014)

  • v1.7.0(Apr 18, 2014)

  • v1.6.0(Apr 18, 2014)

    • Reworked Form Buttons section
    • Add disabled buttons
    • Add fieldset examples
    • Reworked Form Fields
    • Add speech recognition input
    • Add time input
    • Add disabled fields
    • Add readonly fields
    Source code(tar.gz)
    Source code(zip)
  • v1.5.0(Apr 18, 2014)

  • v1.4.0(Apr 18, 2014)

  • v1.3.0(Apr 18, 2014)

    • Remove headings in hgroup
    • Add small text and link in heading examples
    • Add address element
    • Add time element
    • Add q element
    • Add international phone input example
    • Add placeholder example
    • Add required field input
    • Add mulitiple select menu
    • Merge HTML5 Form Fields section into Form Fields section
    Source code(tar.gz)
    Source code(zip)
  • v1.2.0(Apr 18, 2014)

  • v1.0.0(Apr 18, 2014)

Owner
Brett Jankord
Software Engineer in Kansas City working on design systems, accessibility, responsive web design, CSS, React, Vue, Node JS, and open source.
Brett Jankord
OpenDialog is a Conversational Experience Platform - the starting point for your own conversational applications.

OpenDialog - open-source conversational application platform OpenDialog enables you to quickly design, develop and deploy conversational applications.

OpenDialog 252 Dec 28, 2022
The perfect starting point to integrate Algolia within your PHP project

⚡️ A fully-featured and blazing-fast PHP API client to interact with Algolia.

Algolia 629 Jan 4, 2023
Open Source Point of Sale is a web based point of sale application written in PHP using CodeIgniter framework.

Open Source Point of Sale is a web based point of sale application written in PHP using CodeIgniter framework. It uses MySQL as the data back end and has a Bootstrap 3 based user interface.

opensourcepos 2.7k Jan 2, 2023
Laravel Craftsman CLI for easily crafting Laravel assets for any project (artisan make on steroids)

Laravel Craftsman Description Laravel Craftsman (written using the awesome Laravel-Zero CLI builder) provides a suite of crafting assets using a proje

Mike Erickson 228 Dec 26, 2022
High-Performance Long-Living PHP Framework for modern enterprise application development

Documentation · Discord · Telegram · Twitter Spiral Framework is a High-Performance Long-Living Full-Stack framework and group of over sixty PSR-compa

Spiral Scout 1.4k Jan 1, 2023
Project template for starting a project based on the Rabble admin system.

Note: this is an experimental project and heavily under development. If you do come across this repository, and you would like to support development,

Rabble 12 Oct 26, 2022
Chain Laravel jobs without having to glue it to a starting job

Laravel Job Chainer JobChainer does chain a variable amount of jobs by adding them with the add() method. This makes it possible to chain jobs without

Just Iversen 69 Nov 18, 2022
A WordPress package to nudge users to upgrade their software versions (starting with PHP)

whip A WordPress package to nudge users to upgrade their software versions (starting with PHP) Requirements The following versions of PHP are supporte

Yoast 71 Oct 18, 2022
Project template for starting your new project based on the Sulu content management system

Sulu is a highly extensible open-source PHP content management system based on the Symfony framework. Sulu is developed to deliver robust multi-lingua

Sulu CMS 188 Dec 28, 2022
Wordpress starting framework for magic websites

Wideo Wordpress starting framework for magic websites. Full documentation: https://github.com/ideonetwork/wideo/wiki Usage Installation for wordpress

Zeranta Digital 4 Dec 13, 2022
This Package helps you in laravel application to log all desired activity for each request from request entry point to generate response at a single snapshot.

Laravel Scenario Logger This Package helps you in laravel application to log all desired activity for each request from request entry point to generat

Mehrdad Mahdian 6 Sep 27, 2021
Connect and work with MySQL/MariaDB database through MySQLi in PHP. This is an introductory project, If you need a simple and straightforward example that takes you straight to the point, you can check out these examples.

First MySQLi PHP Connect and work with MySQL/MariaDB database through MySQLi in PHP. The above exercises are designed for students. This is an introdu

Max Base 4 Feb 22, 2022
Lakasir is a free, open source and online Point Of Sale Software designed for small shop or retail

Lakasir is a free, open source and online Point Of Sale Software designed for small shop or retail. It is built with modern technologies such as Laravel, VueJS, Bootstrap 4, RESTful API etc.

Lakasir 234 Dec 31, 2022
With the help of QR code technologies, digital entry passes can be created, which a user can show at the entry point to pass the door.

Navratri_Entry With the help of QR code technologies, digital entry passes can be created, which a user can show at the entry point to pass the door.

Kushang Shah 5 Aug 7, 2022
SpawnInLobby Pocketmine-MP plugin. With this plugin the player will always join the game at the default world spawn point

SpawnInLobby Pocketmine-MP plugin. With this plugin the player will always join the game at the default world spawn point

null 1 Jan 7, 2022
Sistem Point Of Sales

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Muhamad Nizar 10 Oct 25, 2022
The light version of NexoPOS 4.x, which is a web-Based Point Of Sale (POS) System build with Laravel, TailwindCSS, and Vue.Js.

About NexoPOS 4.x NexoPOS 4 is a free point of sale system build using Laravel, TailwindCSS, Vue and other open-source resources. This POS System focu

Blair Jersyer 402 Jan 7, 2023