Coder Social home page Coder Social logo

iainvdw / supple Goto Github PK

View Code? Open in Web Editor NEW

This project forked from supple-kit/supple-css

0.0 1.0 0.0 354 KB

In browser (S)CSS framework; Fluid, Variable, supple if you will

Home Page: https://supple-css.github.io/supple/

License: MIT License

CSS 59.22% JavaScript 0.14% HTML 40.63%

supple's Introduction

Supple (S)CSS framework supple Logo

npm (scoped) npm changelog

Why use supple:

It is a small but powerfull (S)CSS framework designed specially with the latest browsers in mind. The framework is made with an eye on the future. It uses custom properties for configuration and utilises new CSS webstandards.

Supple provides little to no design wich means no undoing other peoples design decisions.

Use supple if:

  • You appreciate the value of Object Oriented code and the need for scalability and reuse.
  • You need a powerful library of defaults & objects.
  • You need a framework that is robust and evolves constantly.

Size

The core framework including all modules without fallbacks for custom-properties weighs about 2.15kB. You can reduce the payload by only including the modules you need, and configure those modules to your needs.

If you want the framework to include all fallbacks for custom-properties the framework comes in at 2.48kB.

Browser support

Supple supports all major browsers which can render CSS custom properties.

If you want to support older browsers (mostly IE11) you’ll need to include the _fractions.scss utility to support our _layout.scss grid system. Other modules also have some configuration to support older browsers, please refer to their own readme files.

Installation

  • npm: npm install supple --save

Note: It is advised to add postcss-autoprefixer to automatically generate vendor prefixes.

Available modules

All supple submodules are created based on the ITCSS methodology.

ITCSS stands for Inverted Triangle CSS and it helps you to organize your project CSS files in such way that you can better deal with CSS specifics like global namespace, cascade and selectors specificity.

Settings

This layer is the first layer and holds any global settings for your project. It should only house settings that need to be accessed from anywhere.

NOTE: Any variable that does not need to be accessed globally should belong in the module to which it relates.

Tools

The tools layer houses your globally available tooling, mixins and functions.

NOTE: Any mixin or function that does not need to be accessed globally should belong in the module template to which it relates.

Generic

It contains ground-zero styles like Normalize.css, global box-sizing rules, CSS resets and so on.

  • generic/_normalize.scss, to flatten cross browser inconsistencies.
    • Note: Although supple has a prepackaged version of normalize.css it is encouraged to include the latest version from normalize.css.
  • generic/_reset.scss, a thin layer on top of normalize.css that provides a starting point more suitable for web applications.

Elements

These are bare, unclassed HTML elements. The Elements layer binds onto HTML element (or 'type') selectors only.

Elements are most likely the last layer in which we'd find element-based selectors, and is very rarely added to or changed after initial setup. Once we have defined element-level styles, all additions and deviations should be implemented using classes.

Objects

This layer is concerned with styling non-cosmetic design patterns, or 'objects'. This can range from something as a .o-wrapper element to .o-layout systems.

All Objects should be prefixed with o-.

Components

This layer contains our recognisable components, chunks of UI.

All Components should be prefixed with c-.

NOTE: Because supple is a design-free framework this layer is completely empty. You can add your own components to your project.

Utilities

this layer contains some handy helpers & overrides. This is the most specific layer of the application which trumps everything defined before.

(*) This set of utilities is only needed if you want to support browsers without custom property support.

All Utilities should be prefixed with u-.

Getting started

Supple is a very design-free framework. This means that the style and design of your site is left entirely up to you. Because supple gives you lots of customisable foundations, you need to add the final layer: UI.

It is advised that you will use supple code throughout your own styles, a sample styles.scss file would look like this:

/* Settings */
@import "node_modules/supple/lib/settings/defaults";
@import "settings/vars";
@import "settings/colors";

/* Tools */
@import "node_modules/supple/lib/tools/functions";
@import "node_modules/supple/lib/tools/mixins";

/* Generic */
@import "normalize";
@import "node_modules/supple/lib/generic/reset";

/* Elements */
@import "node_modules/supple/lib/elements/headings";
@import "elements/links";

/* Objects */
@import "node_modules/supple/lib/objects/list-clean";
@import "node_modules/supple/lib/objects/layout";
@import "node_modules/supple/lib/objects/flexembed";
@import "objects/box";
@import "objects/media";

/* Components */
@import "components/buttons";
@import "components/masthead";
@import "components/navigation.main";

/* Utilities */
@import "node_modules/supple/lib/utilities/fractions";
@import "node_modules/supple/lib/utilities/module";
@import "node_modules/supple/lib/utilities/visually-hidden";
@import "node_modules/supple/lib/utilities/hidden";
@import "utilities/visibility";
@import "utilities/text";

The file index.scss is added as a reference file on how you could implement the smaller modules.

Credits

Supple is derived by the ideas of many other developers:

And probably more…

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.