Code Monkey home page Code Monkey logo

colette's Introduction

Introducing Colette

Colette is a CSS and JS starter kit for 20 Minutes web projects. It provides basic styles and mixins to build responsive layouts, based on the 20 Minutes digital identity guidelines.


Features

  • basic typography: headings, body text, lists, etc.
  • helpers: colors, borders, icons, etc.
  • grid system: 12-columns based, with customizable breakpoints
  • ready-to-use HTML/CSS components: buttons, navbar, socialbar, content teasers, media, and loading animation

Dependencies


Installation

With npm (recommended)

npm install colette --save

Download

  • See the dist/ directory for ready-to-use CSS files.
  • If you want to use Colette as a kickstarter for custom stylus/css projects, check src/.

Use Colette’s styles from Stylus sources

You can use colette.css as is (or minified files colette.min.css).

But the best way to use Colette is by Stylus and JavaScript sources with a task-runner (ex: gulp, webpack).

Use gulp

To compile your stylus, use gulp and gulp-stylus

/* gulpfile.js */
gulp.task('css', function () {
   return gulp.src(cfg.cssDir + '*.styl')
   .pipe(stylus({
        include: [
            PATH_TO_STYLUS_IMPORT,
            AN_OTHER_PATH_TO_FIND_STYLUS_MODULES
        ],
        'include css': true
    }))
   .pipe(gulp.dest('css/'))
})

PATH_TO_STYLUS_IMPORT could be node_modules for example if you use npm.

Use webpack

To compile your stylus, use stylus-loader

/* webpack.config.js */
{
  test: /\.styl$/i,
  use: [
    'style-loader',
    'css-loader',
    'postcss-loader',
    {
      loader: 'stylus-loader',
      options: {
        paths: [
          'node_modules',
        ],
        'include css': true,
        'resolve url': true,
        stylus: {
          preferPathResolver: 'webpack',
        },
      },
    },
  ],
}

Partial import

Colette is a collection of stylus features. You can define which styles you want to include into your final CSS file with stylus import.

By default, you include all colette.styl and all features are in your CSS. You can select features needed by copying colette.styl content and choose your imports rules.

/* my_css_file.styl */

// Your own settings

// Import colette
@require 'colette/assets/styl/colette'

/* => will compile to my_css_file.css */

But can be usefull to:

  • change order of imports,
  • import only needed features,
  • separate your critical CSS from your global CSS.

Use Colette’s JavaScript from sources

You can use colette.min.js as is.

But the best way to use it is with a task-runner by JavaScript sources (ex: gulp, webpack).

You should use babel to transpile colette code to Javascript for Browsers.

colette's People

Contributors

dependabot-preview[bot] avatar nredoulez avatar eguyot avatar ryuran avatar j0k3r avatar greg-pep avatar dependabot[bot] avatar webda2l avatar kystermax avatar hugobaches avatar menthefraiche avatar tangurb1 avatar

Watchers

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