Skip to content

Commit

Permalink
Added syntax highlighting (#79)
Browse files Browse the repository at this point in the history
For easier scanning, hope it helps!
  • Loading branch information
oyeanuj authored and paulirish committed May 22, 2017
1 parent 249caa6 commit 8ae192e
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,25 @@ His code: https://github.com/fofr/matchMedia.js -- though currently it doesnt su
## Usage

#### test 'tv' media type
if (matchMedia('tv').matches) {
// tv media type supported
}
```js
if (matchMedia('tv').matches) {
// tv media type supported
}
```

### test a mobile device media query
if (matchMedia('only screen and (max-width: 480px)').matches) {
// smartphone/iphone... maybe run some small-screen related dom scripting?
}

#### test landscape orientation
if (matchMedia('all and (orientation:landscape)').matches) {
// probably tablet in widescreen view
}
```js
if (matchMedia('only screen and (max-width: 480px)').matches) {
// smartphone/iphone... maybe run some small-screen related dom scripting?
}
```

#### test landscape orientation
```js
if (matchMedia('all and (orientation:landscape)').matches) {
// probably tablet in widescreen view
}
```

## Used in:

Expand Down

0 comments on commit 8ae192e

Please sign in to comment.