Skip to content
This repository was archived by the owner on May 7, 2025. It is now read-only.

Commit ca32ace

Browse files
committed
Readium fork sync
1 parent b2c9cec commit ca32ace

File tree

8 files changed

+1291
-219
lines changed

8 files changed

+1291
-219
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ Features:
1313

1414
- no performance issues since it listens only on size changes of elements that have element query rules defined through css. Other element query polifills only listen on `window.onresize` which causes performance issues and allows only to detect changes via window.resize event and not inside layout changes like css3 animation, :hover, DOM changes etc.
1515
- no interval/timeout detection. Truly event-based through integrated ResizeSensor class.
16+
- automatically discovers new DOM elements. No need to call javascript manually.
1617
- no CSS modifications. Valid CSS Syntax
17-
- all CSS selectors available. Uses regular attribute selector. No need to write rules in HTML.
18-
- supports and tested in webkit, gecko and IE(7/8/9/10/11)
18+
- all CSS selectors available. Uses regular attribute selector. No need to write rules in HTML/JS.
19+
- supports and tested in webkit, gecko and IE(10+)
1920
- `min-width`, `min-height`, `max-width` and `max-height` are supported so far
2021
- works with any layout modifications: HTML (innerHTML etc), inline styles, DOM mutation, CSS3 transitions, fluid layout changes (also percent changes), pseudo classes (:hover etc.), window resizes and more
2122
- no Javascript-Framework dependency (works with jQuery, Mootools, etc.)
@@ -50,7 +51,7 @@ More demos and information: http://marcj.github.io/css-element-queries/
5051

5152
As you can see we use the `~=` [attribute selector](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors).
5253
Since this css-element-queries polyfill adds new element attributes on the DOM element
53-
(`<div class="widget-name" min-width="400px 700px"></div>`) depending on your actual CSS,
54+
(`<div class="widget-name" min-width="400px 700px"></div>`) depending on your actual CSS and element's dimension,
5455
you should always use this attribute selector (especially if you have several element query rules on the same element).
5556

5657
```html
@@ -88,22 +89,23 @@ Here live http://marcj.github.io/css-element-queries/.
8889
If you're using a module loader you need to trigger the event listening or initialization yourself:
8990

9091
```javascript
91-
var EQ = require('node_modules/css-element-queries/ElementQueries');
92+
var ElementQueries = require('css-element-queries/src/ElementQueries');
9293

9394
//attaches to DOMLoadContent
94-
EQ.listen();
95+
ElementQueries.listen();
9596

9697
//or if you want to trigger it yourself.
9798
// Parse all available CSS and attach ResizeSensor to those elements which have rules attached
9899
// (make sure this is called after 'load' event, because CSS files are not ready when domReady is fired.
99-
EQ.init();
100+
ElementQueries.init();
100101
```
101102

102103
## Issues
103104

104105
- So far does not work on `img` and other elements that can't contain other elements. Wrapping with a `div` works fine though (See demo).
105106
- Adds additional hidden elements into selected target element and forces target element to be relative or absolute.
106107
- Local stylesheets do not work (using `file://` protocol).
108+
- If you have rules on an element that has a css animation, also add `element-queries`. E.g. `.widget-name { animation: 2sec my-animation, 1s element-queries;}`. We use this to detect new added DOM elements automatically.
107109

108110
## License
109111

package.json

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
11
{
2-
"name": "css-element-queries",
3-
"version": "0.3.2",
2+
"author": {
3+
"name": "Marc J. Schmidt"
4+
},
5+
"bugs": {
6+
"url": "https://github.com/marcj/css-element-queries/issues"
7+
},
48
"description": "CSS-Element-Queries Polyfill. proof-of-concept for high-speed element dimension/media queries in valid css.",
5-
"main": "index.js",
9+
"devDependencies": {
10+
"grunt": "^0.4.5",
11+
"grunt-bump": "^0.3.1"
12+
},
613
"directories": {
714
"test": "test"
815
},
9-
"scripts": {
10-
"test": "echo \"Error: no test specified\" && exit 1"
11-
},
16+
"homepage": "https://github.com/marcj/css-element-queries",
17+
"license": "MIT",
18+
"main": "index.js",
19+
"name": "css-element-queries",
1220
"repository": {
1321
"type": "git",
14-
"url": "git@github.com:marcj/css-element-queries.git"
22+
"url": "git+ssh://git@github.com/marcj/css-element-queries.git"
1523
},
16-
"author": "Marc J. Schmidt",
17-
"license": "MIT",
18-
"bugs": {
19-
"url": "https://github.com/marcj/css-element-queries/issues"
24+
"scripts": {
25+
"test": "echo \"Error: no test specified\" && exit 1"
2026
},
21-
"homepage": "https://github.com/marcj/css-element-queries",
22-
"devDependencies": {
23-
"grunt": "^0.4.5",
24-
"grunt-bump": "^0.3.1"
25-
}
27+
"version": "1.0.2"
2628
}

0 commit comments

Comments
 (0)