Giter Site home page Giter Site logo

alexroutledge / css-regions-polyfill Goto Github PK

View Code? Open in Web Editor NEW

This project forked from adobe-webplatform/css-regions-polyfill

0.0 2.0 0.0 2.49 MB

Experimental CSS Regions polyfill written in JavaScript

Home Page: http://adobe-webplatform.github.com/css-regions-polyfill

License: Other

CSS 7.74% JavaScript 92.26%

css-regions-polyfill's Introduction

CSS Regions polyfill

Prototype library for using CSS Regions features in browsers that don't have support for them.

Usage

Include the polyfill script in your page

<script src='cssregions.js'></script>

Use standard CSS regions syntax on the same page.

#content{             
    /* pull content into a named flow */
    flow-into: myflow; 
}

.region{
    /* flow the content into other boxes */
    flow-from: myFlow;
    
    width: 200px;
    height: 100px;
}

The #content will be extracted and split across .region elements. Regions should be block elements and have explicit dimensions for the polyfill to work.

Contributing

DO NOT directly modify the cssregions.js or cssregions.min.js files in the project root. These files are automatically built from components located under the src/ directory.

The project uses Grunt to automate the build process.

Grunt depends on Node.js and npm.

Install Grunt

npm install -g grunt

Tell Grunt to watch for changes and automatically build cssregions.js and cssregions.min.js:

cd ./path/to/polyfill/
grunt watch

While grunt watch is running, every time you make changes to components under src/ the main files, cssregions.js and cssregions.min.js, are built and written to the project root.

To do a one-time build run:

grunt build

Testing

The polyfill has a QUnit test suite in the /test/ folder. New code should include at least one test.

Requirements

Setup QUnit

QUnit is linked as a git submodule to this project. Submodules need to be sync-ed before the first test run.

Go to the project root directory and sync the git sumbmodules (includes QUnit):

cd ./path/to/polyfill/
git submodule update --init

Run the tests

Open the test/index.html file in a browser. This runs the QUnit test suite. Refresh compulsively after making changes to project files. You can automatically run the test suite with other tools. See below.

Optionals

Testem automatically runs the QUnit suite across browsers as you make changes to the files. A configuration is provided in /testem.json. Testem is optional, but pretty cool.

Testem depends on NodeJS and npm.

Install Testem

npm install testem -g

Run Testem

cd ./path/to/polyfill/
testem

This command will open up the browsers specified in the testem.json config file and run the test suite located at /test/index.html. As you make changes to any of the files, Testem will re-run the tests.

Learn more from the Testem docs

License information

The code in this repository implies and respects different licenses. This is a quick overview. For details check each folder's corresponding LICENSE.md file.

  • Apache 2 for CSS Regions polyfill
  • Public Domain for tests, demos and docs
  • Third party assets under their own licenses

See LICENSE.md for details.

css-regions-polyfill's People

Contributors

mcorlan avatar oslego avatar cataling avatar silverma avatar jacobgoldstein avatar

Watchers

James Cloos avatar Alex Routledge 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.