GithubHelp home page GithubHelp logo

suit-utils's Introduction

SUIT utilities

A SUIT collection of utility classes for common, reusable, low-level CSS traits. The collection includes text, link, display, layout, space, and state utilities.

Read more about SUIT's design principles.

Installation

  • Download: zip
  • Bower: bower install suit-utils
  • Git: git clone https://github.com/necolas/suit-utils.git

Usage

Referencing

During development, you can include the utilities you need using the @import directive in your main stylesheet. Your build step should take care of inlining these imports for production.

Example:

@import "/components/normalize-css/normalize.css";

/* Utilities */

@import "/components/suit-utils/display.css";
@import "/components/suit-utils/layout.css";
@import "/components/suit-utils/space.css";
@import "/components/suit-utils/state.css";
@import "/components/suit-utils/text.css";
@import "/components/suit-utils/link.css";

@import "/components/app-css-utils/mycustom-util.css";
...

Templating

Apply the desired trait, or combination of traits, directly to the HTML element in a component's template.

These simple utilities can be used to create a wide variety of UI patterns that can form the basis for virtual and specific components.

The following contrived example would be a structural template for a simple tweet-like component. You would then create a new component CSS file to house any additional, specific styles that are needed to fully realise this component.

<article class="tweet">
    <a class="obj-end" href="[permalink]">
        [timestamp]
    </a>
    <a class="obj-start" href="[href]">
        <img src="[src]" alt="[username]'s avatar">
    </a>
    <div class="nbfc">
        <a class="link-complex" href="[url]">
            <span class="link-complex__target">[full-name]</span>
            <span>@username</span>
        </a>

        <p>
            <a class="link-complex" href="#">
                @<span class="link-complex__target">username</span>
            </a>
            [tweet-text]
        </p>

        <div>
            <a href="#">
                <span>Expand</span>
                <span class="is-hidden">Collapse</span>
            </a>
            <a class="link-complex" href="#">
                <i class="icon icon--reply"></i>
                <span class="link-complex__target">Reply</span>
            </a>
            <a href="#">
                <i class="icon icon--favorite"></i>
                <span class="is-vishidden">Favorite</span>
            </a>
            ...
        </div>
    </div>
</article>

Browser support

  • Google Chrome (latest)
  • Opera (latest)
  • Firefox 4+
  • Safari 5+
  • Internet Explorer 8+

suit-utils's People

Contributors

necolas avatar

Watchers

Fred avatar  avatar

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.