Skip to content

Commit

Permalink
Merge pull request #19 from wilsonpage/1115224
Browse files Browse the repository at this point in the history
Improved tests, pulled out font-fit, added title-start/title-end attrs
  • Loading branch information
wilsonpage committed Jan 28, 2015
2 parents 8fb74f6 + 0be3deb commit 8b61323
Show file tree
Hide file tree
Showing 12 changed files with 2,353 additions and 1,650 deletions.
4 changes: 3 additions & 1 deletion .jshintrc
@@ -1,4 +1,6 @@
{
"strict": false,
"laxbreak": true,
"esnext": true,
"boss": true,
"node": true
}
32 changes: 32 additions & 0 deletions README.md
Expand Up @@ -20,6 +20,38 @@ If your would like tests to run on file change use:

`$ npm run test-dev`

## Optimizing with `title-start` & `title-end`

If your header contains custom buttons you can optimize setup time by providing the title's start and end offsets. This avoids the component having to read dimensions from the DOM, which can be costly.

```html
<gaia-header action="back" title-start="50" title-end="100">
<h1>title</h1>
<button data-icon="add"></button>
<button data-icon="settings"></button>
</gaia-header>
```

## `not-flush`

```html
<gaia-header action="back" not-flush>
<h1>title</h1>
</gaia-header>
```

By default the gaia-header component assumes that it is flush with the `window` edge when fitting text and centering the title. When the component is not flush with the window edge, the `not-flush` attribute should be used.

### `no-font-fit`

```html
<gaia-header action="back" no-font-fit>
<h1>title</h1>
</gaia-header>
```

Prevents font-fit logic from running. Will run when the attribute is removed. You may choose to use this for app specific performance optimizations.

## Localization

If choosing to use the built in action-button you may wish to localize the content within. You can do this by providing a specicial `.l10n-action` child node.
Expand Down
3 changes: 2 additions & 1 deletion bower.json
Expand Up @@ -19,7 +19,8 @@
],
"dependencies": {
"gaia-icons": "gaia-components/gaia-icons#~0.7.0",
"gaia-component": "gaia-components/gaia-component#~0.1.3"
"gaia-component": "gaia-components/gaia-component#~0.2.0",
"font-fit": "gaia-components/font-fit#~0.2.2"
},
"devDependencies": {
"gaia-theme": "gaia-components/gaia-theme",
Expand Down

0 comments on commit 8b61323

Please sign in to comment.