Skip to content

Commit

Permalink
feat: work on hydration
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Mar 17, 2018
1 parent 9de1af8 commit 5f4dc5c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
6 changes: 2 additions & 4 deletions addon/hydrate.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@ exports.addon = function (renderer, id) {

var cssRules = stylesheet.cssRules;

for (var i = 0; i < cssRules.length; i++) {
var rule = cssRules[i];
hydrated[rule.selectorText] = 1;
}
for (var i = 0; i < cssRules.length; i++)
hydrated[cssRules[i].selectorText] = 1;

var put = renderer.put;

Expand Down
2 changes: 1 addition & 1 deletion docs/hydrate.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ html += `<style id="nano-css">${nano.raw}</style>`;
```

That's it! `hydrate` addon will find this stylesheet in the browser and will not emit CSS
rules that are already there.
rules that were already generated by the server.


## Installation
Expand Down
2 changes: 0 additions & 2 deletions docs/rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ and semantic reasons.
const className = rule(css, 'RedText');
```

---

> __P.S.__
>
> If you specify all style names explicitly, you don't need to install `stable` addon.
Expand Down
4 changes: 2 additions & 2 deletions docs/style.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const Button = style(ButtonWhitelist, {
// ...
});

<Button title="Click it!" onClick={}>Click me!</Button>
<Button primary small title="Click it!" onClick={}>Click me!</Button>
```
Expand All @@ -106,7 +106,7 @@ const Button = style(ButtonBlacklist, {
// ...
});

<Button title="Click it!" onClick={}>Click me!</Button>
<Button primary small title="Click it!" onClick={}>Click me!</Button>
```
Expand Down

0 comments on commit 5f4dc5c

Please sign in to comment.