Detalhes do pacote

flexibility

jonathantneal144.2kMIT2.0.1

A JavaScript polyfill for Flexbox

flex, display, direction, wrap

readme (leia-me)

flexibility

Flexibility Logo

A JavaScript polyfill for Flexbox

npm bower ci gitter

Flexibility is a polyfill for the Flexible Box Layout, commonly known as Flexbox. With Flexibility, you get to design beautiful, flexible layouts on the web without sacrificing the experience in older browsers.

Flexbox lays out, aligns, and distributes elements in a container, even when their size is unknown or dynamic. To better understand Flexbox, read Chris Coyier’s excellent Complete Guide to Flexbox.

To start using Flexbox in Internet Explorer 8 & 9 or any older browser, download the flexibility.js script and include it anywhere on your page.

<script src="flexibility.js"></script>

If you’re only targeting Internet Explorer 10 and lower, add a -js-display: flex declaration before any display: flex declarations in your CSS, or use PostCSS Flexibility to automate this during your build process.

.container {
    -js-display: flex;
    display: flex;
}

If you’re targeting other browsers, use the data-style attribute to alert these browsers to your changes.

<div data-style="display: flex;"></div>

When you’re ready to polyfill flexbox with JavaScript, use the flexibility method on the outermost element you would like to polyfill.

flexibility(document.documentElement);

API

The global flexibility method contains child functions for use within your own framework.

flexibility.read

Argument: Element

Return flexbox related styles from an element.

flexibility.readAll

Argument: Element

Return a list of flexbox details from a matching element or its descendants.

flexibility.write

Argument: Details

Writes flexbox details back to their respective elements.

flexibility.writeAll

Argument: Array

Writes a list of flexbox details back to their respective elements.


To learn more about Flexibility, read the support section.

If you experience an issue, read the contributing section before creating an issue.

changelog (log de mudanças)

Change Log

Flexibility Logo

npm bower ci gitter

2.0.1 (2016-06-29)

  • Added: Support border widths in relation to border styles

2.0.0 (2016-06-28)

  • Added: Support for flexboxes directly nested within flexboxes
  • Added: Support for box-sizing, flex-basis, flex-shrink and margin properties
  • Updated: Complete rewrite

1.0.6 (2016-01-18)

  • Updated: Improved handling of css-layout
  • Updated: Cleanup length caching

1.0.5 (2016-01-18)

  • Updated: Height calculation on flex container

1.0.4 (2016-01-18)

  • Added: Watch task for development
  • Added: onresize response to viewport height changes
  • Updated: Length calculations for percentages
  • Updated: Tests

1.0.3 (2016-01-18)

  • Added: Support for flex-grow and partial support for flex.
  • Added: Support for flex-flow.
  • Updated: Improved support for IE9 inline styles
  • Updated: Documentation and tests
  • Updated: Build process

1.0.2 (2016-01-14)

  • Updated: Percentage calculations support
  • Updated: Tests
  • Updated: Build process

1.0.1 (2016-01-14)

  • Updated: Reduced resize and length calculations
  • Updated: Tests and documentation

1.0.0 (2016-01-14)

  • Added: Use CSS Layout for Flexbox positioning (https://github.com/facebook/css-layout)
  • Added: Support for all longhand Flexbox properties
  • Added: Automatic display updates during window resize
  • Added: Ability to manually toggle display updates (useful during CSS changes)
  • Added: Visual tests
  • Updated: Documentation

0.3.0 (2016-01-08)

  • Added: Bower configuration
  • Updated: Fallback for objects without currentStyle (<svg>)
  • Updated: White-spacing handling in IE9
  • Updated: Lint and test configurations

0.2.3 (2015-12-30)

  • Updated: License updated in README.md

0.2.2 (2015-12-30)

  • Updated: License updated from GPL to MIT

0.2.1 (2015-12-14)

  • Updated: Only allow elements as children of flex at this time

0.2.0 (2015-12-08)

  • Added: Initial release

To learn more about Flexibility, read the support section.

If you experience an issue, read the contributing section before creating an issue.