Skip to content

Commit

Permalink
include css in src for simplicity
Browse files Browse the repository at this point in the history
  • Loading branch information
Corey Wilson committed May 25, 2016
1 parent 2358691 commit 1bbec97
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 15 deletions.
22 changes: 8 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ Install via Bower:

`$ bower install angular-stickyfill --save`

1. Include `angular-stickyfill.js` (if not auto included from it's bower dependency by your build process)
1. Include `angular-stickyfill.js` and `angular-stickyfill.css` (if not auto included from it's bower dependency by your build process)

`<link rel="stylesheet" href="bower_components/angular-stickyfill/src/angular-stickyfill.css" />`
`<script src="bower_components/angular-stickyfill/src/angular-stickyfill.js"></script>`

2. Include [Stickyfill](https://github.com/wilddeer/stickyfill):
Expand All @@ -33,19 +34,12 @@ Example:
</div>
```

CSS:
```css
.side-menu {
position: -webkit-sticky;
position: sticky;
top: 0;
}
(Optional) By default the sticky `top` is set to 0, you can override
this in your local CSS by adding the following:

.side-menu:before,
.side-menu:after {
content: '';
display: table;
Example:
```css
[ec-stickyfill] {
top: 10px;
}
```


5 changes: 4 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
"Corey Wilson <[email protected]>"
],
"description": "Angular directive for stickyfill (position sticky polyfill)",
"main": "src/angular-stickyfill.js",
"main": [
"src/angular-stickyfill.js",
"src/angular-stickyfill.css"
],
"moduleType": [],
"keywords": [
"angular",
Expand Down
11 changes: 11 additions & 0 deletions src/angular-stickyfill.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[ec-stickyfill] {
position: -webkit-sticky;
position: sticky;
top: 0px;
}

[ec-stickyfill]:before,
[ec-stickyfill]:after {
content: '';
display: table;
}

0 comments on commit 1bbec97

Please sign in to comment.