Giter Site home page Giter Site logo

bjankord / style-guide-boilerplate Goto Github PK

View Code? Open in Web Editor NEW
1.9K 107.0 463.0 467 KB

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

Home Page: http://bjankord.github.io/Style-Guide-Boilerplate/

License: Other

CSS 15.80% PHP 25.06% JavaScript 2.72% HTML 56.42%
styleguide boilerplate html css

style-guide-boilerplate's Introduction

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

style-guide-boilerplate's People

Contributors

bjankord avatar davidhund avatar diveruzumaki avatar dmecke avatar geoffyoung avatar gitter-badger avatar marclaporte avatar waterworth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

style-guide-boilerplate's Issues

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 { … }

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.

Easy way to copy code.

It would be a good idea if there were an easy way to copy the code from the source window. Perhaps a little button? Cheers.

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

php?

I want to use your boilerplate locally. And i do not have php installed. Can i still use your boilerplate?

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

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?

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.

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?

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.

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

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 ..

isolate section

It would be nice if you could see one section by itself... click on the title and load just that section.

Thanks for this though...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.