All Projects → motine → css_grid_annotator

motine / css_grid_annotator

Licence: MIT license
Automatically annotate CSS Grid items with row and column positions, so they are correctly positioned in IE11.

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to css grid annotator

PHPUnit-Polyfills
Set of polyfills for changed PHPUnit functionality to allow for creating PHPUnit cross-version compatible tests
Stars: ✭ 147 (+149.15%)
Mutual labels:  polyfill
react-native-audio-polyfill
Audio polyfill for desktop and native.
Stars: ✭ 13 (-77.97%)
Mutual labels:  polyfill
css-grid-layout-generator
The Quickest & Easiest Way To Build Complex CSS Grid Layouts
Stars: ✭ 65 (+10.17%)
Mutual labels:  css-grid
draggable-polyfill
🌈a beautify polyfill for native drag!
Stars: ✭ 49 (-16.95%)
Mutual labels:  polyfill
parsed-html-rewriter
A DOM-based implementation of Cloudflare Worker's HTMLRewriter.
Stars: ✭ 34 (-42.37%)
Mutual labels:  polyfill
seamless-scroll-polyfill
Scroll Behavior polyfill
Stars: ✭ 134 (+127.12%)
Mutual labels:  polyfill
DisplayStructureElements
Display the structure of the elements in web template.
Stars: ✭ 17 (-71.19%)
Mutual labels:  css-grid
react-native-drawer-layout-polyfill
A polyfill for React Natives DrawerLayoutAndroid
Stars: ✭ 48 (-18.64%)
Mutual labels:  polyfill
core2
The bare essentials of std::io for use in no_std. Alloc support is optional.
Stars: ✭ 67 (+13.56%)
Mutual labels:  polyfill
ember-on-modifier
Implements the `{{on eventName this.someAction}}` element modifier from https://github.com/emberjs/rfcs/blob/master/text/0471-on-modifier.md
Stars: ✭ 37 (-37.29%)
Mutual labels:  polyfill
react-native-console-time-polyfill
console.time and console.timeEnd polyfill for react-native
Stars: ✭ 92 (+55.93%)
Mutual labels:  polyfill
grid-garden
Solutions to CSS Grid Garden
Stars: ✭ 79 (+33.9%)
Mutual labels:  css-grid
sanitizer-polyfill
rewrite constructor arguments, call DOMPurify, profit
Stars: ✭ 46 (-22.03%)
Mutual labels:  polyfill
60gs
60GS - 60 Columns Grid System based on CSS Grid Layout
Stars: ✭ 65 (+10.17%)
Mutual labels:  css-grid
deno-fetch-event-adapter
Dispatches global fetch events using Deno's native http server.
Stars: ✭ 18 (-69.49%)
Mutual labels:  polyfill
IsExternalInit
A source code only package which allows you to use C# 9's init and record features in older target frameworks like .NET Standard 2.0 or the "old" .NET Framework by providing a polyfill for the IsExternalInit class.
Stars: ✭ 75 (+27.12%)
Mutual labels:  polyfill
array-includes
Array.prototype.includes spec-compliant polyfill
Stars: ✭ 42 (-28.81%)
Mutual labels:  polyfill
vanilla-js
Projects using pure JavaScript without any external libraries or frameworks
Stars: ✭ 129 (+118.64%)
Mutual labels:  css-grid
cardboard-vr-display
A JavaScript implementation of a WebVR 1.1 VRDisplay
Stars: ✭ 84 (+42.37%)
Mutual labels:  polyfill
String.prototype.trim
ES5 spec-compliant shim for String.prototype.trim
Stars: ✭ 13 (-77.97%)
Mutual labels:  polyfill

CSS Grid Annotator

CSS Grid is great, but IE11 assumes that all items are in the first row and first column. Please check out this blog post by Valentina and me. So, you have to add a lot of styles to explicitly position your grid items. This script automatically adds the positioning attributes for IE11.

Demo: before, after

It looks through all elements on the page and checks if the display property equals -ms-grid. If so it will annotate each visible child with explicit -ms-grid-column / -ms-grid-row based on -ms-grid-columns (-ms-grid-rows are ignored).

Please check back under the releases tab for recent releases.

Gotchas

  • The script is only applied when IE11 is found.
  • The script does checks only for the prefixed grid property -ms-grid.
  • The script currently only supports grid-template-columns. This script does not work if there is only grid-template-rows specified.
  • If there are more items/children specified than columns in the the template, new rows will be created.
  • If there any of the children is annotated with an explicit -ms-grid-column or -ms-grid-row, the whole container will be skipped.
  • Hidden elements are skipped (type="hidden" or display: none).
  • The script also annotates containers which are dynamically inserted via JavaScript. But, items are only annotated if a grid container is inserted, inserting individual items stay unannotated.

More to do

  • Consider template rows.
  • Annotate items if they are dynamically added individually.

Contribute

Please feel free to add issues, to contribute via pull requests or to reach out to me.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].