• Stars
    star
    159
  • Rank 235,916 (Top 5 %)
  • Language
    JavaScript
  • License
    Other
  • Created about 12 years ago
  • Updated over 10 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Experimental CSS Regions polyfill written in JavaScript

CSS Regions polyfill

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

UPDATE, April 2014: This polyfill is obsolete.

François Remy wrote an improved CSS Regions polyfill with better browser support and broader feature coverage.

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-driven test suite in the /test/ folder. New code should include at least one test.

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.

More Repositories

1

Snap.svg

The JavaScript library for modern SVG graphics.
JavaScript
13,954
star
2

dropcap.js

Beautiful CSS drop caps made easy
HTML
929
star
3

eve

Custom events…
JavaScript
316
star
4

css-shapes-polyfill

Polyfill for the CSS Shapes Specification
JavaScript
303
star
5

Demo-for-Alice-s-Adventures-in-Wonderland

Demo of CSS Shapes using the Alice in Wonderland story.
CSS
149
star
6

Demo-for-National-Geographic-Forest-Giant

A prototypical adaptation of the National Geographic article "Forest Giants" using Adobe's contributions to WebKit.
JavaScript
135
star
7

css-shapes-editor

Standalone in-browser editor for CSS Shapes.
JavaScript
120
star
8

dr.js

Tiny documentation builder
JavaScript
114
star
9

shaderdsl

A compiler from a subset of JavaScript to GLSL.
JavaScript
97
star
10

brackets-css-shapes-editor

CSS Shapes Editor extension for Brackets / Adobe Edge Code
JavaScript
94
star
11

custom-filters-demo-travel-app

An app that explores the use of custom filters to create UI enhancements
JavaScript
55
star
12

iframeflow.js

A Javascript helper for cross-browser CSS Regions support
JavaScript
41
star
13

coding-guidelines

JavaScript
28
star
14

Demo-for-PBS-Kids-Word-Girl

Digital comic book adaptation using Photoshop Generator
JavaScript
21
star
15

Demo-for-Food-Network-Cupcakes

Demo using Food Network content to showcase Web Engine features
JavaScript
21
star
16

Demo-for-National-Geographic-Orphan-Elephants

A prototypical adaptation of the National Geographic article "Orphan Elephants" showcasing Regions in use with Viewport Units.
JavaScript
15
star
17

html5devconf-2013

Slides from @adobe-webplatform team presented at HTML5 Dev Conf.
CSS
14
star
18

road-trip

“Road Trip” CSS Regions Demo
JavaScript
7
star
19

exclusionsrecipe

Demo of exclusions for mobile.
CSS
7
star
20

regions-adaptive

Demo of an adaptive web app UI built with CSS Regions
6
star
21

transform-tests

2
star