Giter VIP home page Giter VIP logo

fett's Introduction

Fett Logo

# Fett [![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/bendman/fett?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

A lightweight pattern library for HTML, CSS, and brand styles.

Description

A site styleguide gives designers and frontend developers one central place to reference brand colors and typography, test new components, and test changes to existing component markup (HTML) and style (CSS).

Fett is meant to be a component library for ideal markup which can then be cloned throughout your own site when building new pages.

What Fett Does

  • Generates styleguide navigation
  • Builds color swatches out of HTML
  • Builds previews of your <code> blocks
  • Syntax highlighting for your <code> blocks

Usage

1. Get Fett

Check the Fett repository somewhere you can serve it. Your styleguide's homepage will be index.html.

Fett itself is a website, ideally served in parallel to your own site. If you use a version control system it is recommended to your instance of Fett within your site's repository, that way Fett markup will always parallel your site's markup.

2. Setup your canvas

The styleguide previews work by injecting each example HTML code block onto an iframe canvas which simulates your site. This provides an isolated preview to render your code into.

The canvas consists of two files:

  • canvas/frame.html The base iframe file into which each code block gets injected. Edit this file to include your site's CSS, preferrably by relative URL.
  • canvas/style-extension.css A Fett-specific CSS file which is also loaded on the canvas. You can use this file to alter how your examples appear within Fett.

3. Build your Styleguide!

A Fett styleguide is written in HTML 5 to be easily editable by everybody who might use it. The styleguide file itself is index.html.

There are a few structures within the styleguide that are useful to know:

  • main > section These sections are the top level navigation.
  • article Contained within the sections, these are where your code examples go.

For details about how to show syntax highlighted code examples, swatches, or previews, look at the Fett documentation.

License

Copyright (c) 2014 Ben Duncan

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:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

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.

fett's People

Contributors

bendman avatar gitter-badger avatar

Stargazers

 avatar

Watchers

 avatar  avatar

fett's Issues

rebuild navigation in vanilla js

This can be built to automatically build navigation. This code should be written to be optional, since it might be a removable plugin in the future.

add optional background inheritance for examples

Some components/features need to show the stylesheet's defined background and others do not. It would be nice to toggle this with a component class, like .canvas-bg or .no-bg. This might be built into the example component or a separate plugin attached to the example component.

For the second (attached) option, it would be nice to have a plugin structure (issue) that fired events to be able to chain plugins together at certain points in the flow.

build a structure to support plugins

People should be able to add their own plugins for Fett outside of Fett.js. There should be an event structure or a plugin registry (method or config, depending on the order of load desired) to make Fett extensible with new components or features without altering the core.

Ideally, eventually people would be able to choose what components or features they want and a build script would output that configuration (css/js) for download. It could also generate a configuration file that devs could upload when updating Fett to keep the same configuration (like Icomoon or CKEditor).

fix conflicting components

certain components conflict with each other. One example is when components are contained within a code example block. These should never be acted upon, and always be treated simply as example code within the block.

A good basic test to see if there are conflicting components is to use Fett to document Fett components themselves.

allow manual size control for example iframes

We need some way to set iframe-specific sizes which don't change from the javascript resizes. Maybe a way to set the starting min-height and min-width.

Should this be from an attribute, adding a way to do example-specific css, or something else?

resize example frames on window resize

The example frames get smaller with the window, so the content can get taller as lines wrap. The iframe sizing code should run when resizing.

โš ๏ธ debounce this handler!

add ability to have hidden example code

This allows you to have a separate source for the iframe example than what is shown. This is particularly useful for things like icon fonts, where you should render all the icons for a preview but only need to show the source code for one.

add a logo

Create a Jango Fett helmet vector for the logo and include it in the styleguide as the logo example, in the styleguide header, and in the readme.

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.