Compare commits

...

932 Commits

Author SHA1 Message Date
Cătălin Mariș
85d79ed6cc v5.2.0 2015-04-30 23:54:24 +03:00
Cătălin Mariș
fee2238978 Update jQuery to v1.11.3
Fix h5bp/html5-boilerplate#1699
2015-04-30 22:00:30 +03:00
Cătălin Mariș
a91fea4cd6 Update and improve README.md 2015-04-16 19:27:57 +03:00
Cătălin Mariș
bf141af507 Docs: Make minor improvements
* Fix broken links and use `https://` where possible.
* Remove the `Servers and Stacks` section (introduced by
  h5bp/html5-boilerplate#1572) from the `misc.md` file, as now, since
  h5bp/html5-boilerplate#1694 was merged, it brings even less value.
2015-04-16 10:31:02 +03:00
H5BP
c0665f0989 Update content from the dist directory [skip ci] 2015-04-16 06:32:33 +00:00
Mathias Bynens
dd6ec22ea5 Update CHANGELOG.md 2015-04-16 08:31:07 +02:00
Patrick Kettner
2de99b2ba3 Deprecate protocol-relative URLs
Always use the HTTPS URL when it’s available.

See also:
* https://github.com/konklone/cdns-to-https#conclusion-cdns-should-redirect-to-https
* http://www.paulirish.com/2010/the-protocol-relative-url/

Close h5bp/html5-boilerplate#1694
2015-04-16 08:30:05 +02:00
Cătălin Mariș
d35a8e9020 Fix broken links in CONTRIBUTING.md 2015-04-13 15:59:26 +03:00
Cătălin Mariș
7463646b48 Update devDependencies 2015-04-12 22:49:02 +03:00
Hans Christian Reinl
0d9f00826a Update the high resolution media query
Add `dppx` variant of `min-resolution` to the high resolution media
query as `dppx` is more accurate¹ than `dpi`.

Notes:

 * since `dppx` is not supported by all browsers the media query
   still needs the `dpi` fallback

 * this change removes the `dppx` related warning² from Blink based
   browsers (e.g.: Chrome, Opera)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

¹ `dpi` (dots per inch) refers to a defined size of pixels where one
  inch is `96px` no matter what, so it does not take into consideration
  the physical inches.

² "Consider using 'dppx' units, as in CSS 'dpi' means dots-per-CSS-inch,
   not dots-per-physical-inch, so does not correspond to the actual 'dpi'
   of a screen. In media query expression: print,
   (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi)"

Fix h5bp/html5-boilerplate#1474
Close h5bp/html5-boilerplate#1691
2015-04-10 14:28:00 +03:00
Cătălin Mariș
6ee34e1ced Fix errors pointed out by JSCS from gulpfile.js 2015-04-10 11:33:56 +03:00
Cătălin Mariș
907838737b Update Apache Server Configs to v2.14.0 2015-04-07 23:53:39 +03:00
Cătălin Mariș
1c93f0a056 v5.1.0 2015-04-01 21:08:35 +03:00
Cătălin Mariș
0c32a937e0 Update CHANGELOG.md
Remove line regarding the inclusion of the `LICENSE.txt` file in the
`dist/` directory as it does not constitute an important change as far
as end users are concerned.
2015-04-01 20:54:33 +03:00
Cătălin Mariș
735b9ad706 Update Normalize.css to v3.0.3. 2015-03-31 07:05:20 +03:00
Cătălin Mariș
f4d731e23c Update devDependencies 2015-03-25 12:13:57 +02:00
H5BP
9581cf3a81 Update content from the dist directory [skip ci] 2015-03-13 20:46:00 +00:00
Matt Smith
c7057bef0c Use Autoprefixer to add the vendor prefixes
Ref h5bp/html5-boilerplate#1682
    https://github.com/h5bp/html5-boilerplate/pull/1682#discussion_r26377139
    https://github.com/postcss/autoprefixer
    https://github.com/sindresorhus/gulp-autoprefixer

Close h5bp/html5-boilerplate#1682
2015-03-13 22:42:27 +02:00
battaglr
4f6a87f985 README.md: Add detailed info about browser support
Close h5bp/html5-boilerplate#1684
2015-03-13 19:10:06 +02:00
Cătălin Mariș
29af44ef9c Update CHANGELOG.md 2015-03-11 17:14:58 +02:00
Cătălin Mariș
eee759bfe1 Use https:// in the Google Analytics snippet
Nowadays HTTPS is fast and increasingly necessary, so using
protocol-relative URLs is becoming an anti-pattern, especially for CDNs.

From https://developers.google.com/speed/libraries/devguide?csw=1#libraries:

 " We recommend that you load libraries from the CDN via HTTPS, even
   if your own website only uses HTTP. Nowadays, performance is fast
   and caching works just the same "

See also: https://github.com/konklone/cdns-to-https#conclusion-cdns-should-redirect-to-https
2015-03-11 17:13:53 +02:00
Cătălin Mariș
57342272e6 Include the LICENSE file in the dist directory
* Rename `LICENSE.md` to `LICENSE.txt` so that more text editors
  know how to open it.

* Make the build step copy the `LICENSE.txt` file in the `dist/`
  directory so that it gets included in the distribution package.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Ref https://www.youtube.com/watch?v=hWDSToC9EV8&t=15m15s
    h5bp/html5-boilerplate#1655

Fix h5bp/html5-boilerplate#1655
Close h5bp/html5-boilerplate#1680
2015-03-11 08:17:57 +02:00
Cătălin Mariș
2431333b63 Update devDependencies 2015-03-11 08:17:09 +02:00
Cătălin Mariș
422537b96c Remove visibility: hidden from .hidden
The `visibility: hidden` declaration was added to the `.hidden` class
in order to prevent¹ some screen readers from announcing the content:

 * JAWS:

   "Announces content in a `span` element hidden with `display: none`
    if it is in an anchor element. This only works with a `span`
    element; other inline elements used in an anchor element, such
    as `em`, `strong`, `abbr`, `code`, and so on, are not announced
    in JAWS."

    (from: http://juicystudio.com/article/screen-readers-display-none.php#jawsdisplaynone)

 * Window-Eyes:

   "if a container has a value specified for the `background-image`
    property, content hidden with `display: none` will be announced
    in Window-Eyes."

    (from http://juicystudio.com/article/screen-readers-display-none.php#wedisplaynone)

Nowadays however, both of those screen reader fixed² their issues,
therefore, the `visibility: hidden` declaration is no longer needed.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

¹ http://juicystudio.com/article/screen-readers-display-none.php
² https://github.com/h5bp/html5-boilerplate/issues/1663#issuecomment-77583110

Fix h5bp/html5-boilerplate#1663
2015-03-06 18:02:03 +02:00
Cătălin Mariș
0a40054b7e Use https:// where possible 2015-03-05 01:41:23 +02:00
Cătălin Mariș
b07c91dad6 Docs: Update links
* Use `https://` for links where possible.
* Fix broken links.
2015-03-05 01:41:23 +02:00
Cătălin Mariș
57639ee786 Docs: Lowercase attr values for X-UA-Compatible
Ref: h5bp/html5-boilerplate#1656
2015-03-05 01:41:23 +02:00
BLooperZ
356e141ec9 Lowercase attr values for x-ua-compatible meta tag
Change made in order to be more consistent with the overall use of
lowercase in `index.html`.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

From https://msdn.microsoft.com/en-us/library/jj676915.aspx:

  "The X-UA-Compatible header isn't case sensitive; however, it must
   appear in the header of the webpage (the HEAD section) before all
   other elements except for the title element and other meta elements."

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Ref h5bp/html5-boilerplate#1656

Close h5bp/html5-boilerplate#1656
Close h5bp/html5-boilerplate#1668
2015-03-05 01:41:00 +02:00
drKraken
c8165a6da0 Update devDependencies
Close h5bp/html5-boilerplate#1679
2015-03-04 22:18:38 +02:00
Cătălin Mariș
c0de8e873a Update Apache Server Configs to v2.13.0 2015-03-04 15:51:05 +02:00
Cătălin Mariș
2a6bb8d219 Update Apache Server Configs to v2.12.0 2015-03-02 23:45:20 +02:00
drKraken
b4bbee5468 Exclude .htaccess from GitHub's language stats
Ref https://github.com/github/linguist#using-gitattributes
Close h5bp/html5-boilerplate#1678
2015-03-02 11:05:19 +02:00
Cătălin Mariș
6443483dd2 Update .travis.yml
* Redirect all output from `export $(cat .to_export_back)` to
  `/dev/null` in order to prevent `export` from leaking the access
  token in the case when, for some odd reason, the `.to_export_back`
  file is not created.

* Regenerate the `secure` key based on a new access token.
2015-02-25 01:09:04 +02:00
Mark Macdonald
192d7fed39 Docs: Add missing period in js.md
Close #1669
2015-02-10 07:12:58 +01:00
Cătălin Mariș
e7465be638 Update .travis.yml
* Add `io.js` runtime.
  https://iojs.org/

* Ensure that the `commit_build_changes.sh` script is only
  executed if the tests pass in all runtimes.
2015-02-09 12:39:44 +02:00
Cătălin Mariș
3575a69db6 Update .travis.yml
* Start using Travis CI's container-based infrastructure.
  http://docs.travis-ci.com/user/workers/container-based-infrastructure/

* Update `Node.js` to `v0.12.0`.
2015-02-08 21:31:24 +02:00
Cătălin Mariș
3be7fe5c01 Update devDependencies 2015-02-07 13:41:05 +02:00
Alex Wigmore
78c84ce701 Docs: Add info about <meta name="theme-color"...>
Ref: https://github.com/whatwg/meta-theme-color
     https://bugzilla.mozilla.org/show_bug.cgi?id=1013913
     https://twitter.com/ahmednefzaoui/status/492344698493997057
     http://updates.html5rocks.com/2014/11/Support-for-theme-color-in-Chrome-39-for-Android

Close: h5bp/html5-boilerplate#1642
2015-02-07 13:33:58 +02:00
Cătălin Mariș
ad26878202 CHANGELOG.md: Add date for the v5.0.0 release 2015-02-07 11:42:42 +02:00
Arthur Verschaeve
60a8ff0336 v5.0.0 2015-02-01 21:56:31 +01:00
H5BP
f61c062ff8 Update content from the dist directory [skip ci] 2015-02-01 20:26:28 +00:00
Paul Irish
4af329eedb changelog: HEAD -> 5.0 2015-02-01 12:25:31 -08:00
Paul Irish
0d5c32fb8b TOC.md - small tweaks in wording 2015-02-01 12:22:23 -08:00
gokulkrishh
db639fd0ec Docs: fix spelling mistake in misc.md
Fix #1652
Close #1652
2014-12-23 07:47:27 +01:00
Arthur Verschaeve
001a6c909a Docs: add info on browserconfig.xml and tile images
Ref #1554
    #1639
2014-12-22 15:02:33 +01:00
Arthur Verschaeve
2fcde1ef33 Docs: add new files to usage.md
Updated `usage.md` to include 4 new files included with the project:

* `.editorconfig`
* `tile-wide.png`, `tile.png` and `browserconfig.xml`

Ref 80530d6b46
    a99d8563dd
Close #1647
2014-12-21 22:54:27 +01:00
Arthur Verschaeve
330b60c212 Update to jQuery 1.11.2
Ref http://blog.jquery.com/2014/12/18/jquery-1-11-2-and-2-1-3-released-safari-fail-safe-edition/
Close #1650
2014-12-21 19:12:45 +01:00
Cătălin Mariș
c97c23c06e Update devDependencies 2014-12-08 17:37:45 +02:00
Cătălin Mariș
0dab796231 Update .travis.yml
Use `commit_build_changes.sh` v0.6.0 and make all the necessary changes
that come with the update.
2014-12-08 17:33:58 +02:00
Arthur Verschaeve
45798ee7f8 README.md: Use https:// where possible
Close h5bp/html5-boilerplate#1640
2014-11-30 19:59:27 +02:00
Cătălin Mariș
598ac20128 Update .travis.yml
Use `commit_build_changes.sh` v0.5.0 and make all the necessary changes
that come with the update.
2014-11-29 23:52:07 +02:00
Cătălin Mariș
10f58216b0 Update devDependencies 2014-11-29 16:18:32 +02:00
Cătălin Mariș
be023b8e2d Clean up package.json
Remove `update_dist_directory` from the `scripts` property as it no
longer works, nor it is needed¹.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

¹ d2740f3c6b
2014-11-21 19:53:21 +02:00
Fagner Brack
7275f79fbc Docs: Link to pages that explain certain concepts
Close h5bp/html5-boilerplate#1637
2014-11-21 11:05:39 +02:00
Fagner Brack
91dc924163 Docs: Remove the extra "this" from CONTRIBUTING.md
Close h5bp/html5-boilerplate#1638
2014-11-21 10:50:58 +02:00
Cătălin Mariș
078a37ae38 Docs: Add link to the GA Demos and Tools website
Ref: https://googledevelopers.blogspot.com/2014/11/google-analytics-demos-tools.html
2014-11-21 00:43:31 +02:00
Cătălin Mariș
1318b71cdf Docs: Remove some outdated info from extend.md 2014-11-21 00:35:45 +02:00
Arthur Verschaeve
45a3adcb2e Docs: Add information about including polyfills
Close h5bp/html5-boilerplate#1636
2014-11-21 00:15:17 +02:00
Morten Bengtson
1d0d78509d Docs: Update information about X-UA-Compatible
Remove statement about

    `<meta http-equiv="X-UA-Compatible" content="IE=edge">`

breaking validation.

Ref: validator/validator#12
     h5bp/html5-boilerplate#1630

Close h5bp/html5-boilerplate#1631
2014-11-09 20:19:23 +02:00
Cătălin Mariș
f6efcf0783 Update .travis.yml
Update the link to the `commit_build_changes.sh` script so
that it points to version 0.4.0.
2014-11-08 03:54:24 +02:00
Cătălin Mariș
98fc61b9d1 Use octothorpes (#) for comments in .editorconfig
For consistency, only use octothorpes (#) for comments in the
`.editorconfig` file.

Ref: http://editorconfig.org/#file-format-details
2014-11-07 22:28:25 +02:00
Cătălin Mariș
8d901e6fb8 Improve inline comments from .travis.yml
Add more information about the `secure` key and what the
`commit_build_changes.sh` script does.
2014-11-07 19:36:13 +02:00
Cătălin Mariș
f1503cb6c3 Update devDependencies 2014-11-07 19:15:21 +02:00
Bo-Yi Wu
eba30f07ac Add informational inline comments in .jshintrc
Close h5bp/html5-boilerplate#1628
2014-11-02 20:09:54 +02:00
Cătălin Mariș
d2740f3c6b Remove update_dist_directory.sh script
Use the more configurable form of the `update_dist_directory.sh`
script the has been added in a separate repository.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Note: The `update_dist_directory.sh` was moved into a different
repository in order to:

  * be more easily maintained
  * allow other projects with similar needs to use it
2014-10-28 19:16:24 +02:00
Cătălin Mariș
3c2aac8001 Split tests based on what they check 2014-10-28 13:35:42 +02:00
Cătălin Mariș
61015dbbea Update Apache Server Configs to v2.11.0 2014-10-27 00:47:30 +02:00
Cătălin Mariș
918c88e372 Update devDependencies 2014-10-23 14:01:08 +03:00
Cătălin Mariș
345925f043 Rename Apple touch icon & add <link> in index.html
Until now we recommended to our users to include an image named
`apple-touch-icon-precomposed.png` in the root of their website.

Since the iOS 8 release however, Safari will no longer request¹
the `/apple-touch-icon-precomposed.png` by default, and instead,
it will make the following requests¹:

    /apple-touch-icon-152x152-precomposed.png
    /apple-touch-icon-152x152.png
    /apple-touch-icon.png

In order to fix this issue we decided¹ to rename
`apple-touch-icon-precomposed.png` to `apple-touch-icon.png`,
and include a `<link>` element in the `index.html`:

    <link rel="apple-touch-icon" href="apple-touch-icon.png">

Notes:

  * Just renaming `apple-touch-icon-precomposed.png` to
    `apple-touch-icon.png` would have also worked², even with
    older version of iOS. Unfortunately, it wouldn't have
    represented a good solution as Apple may change again what
    is requested by default, plus, it would have generated quite
    a few 404s³.

  * We decided to rename the touch icon because most iOS users⁴
    are on iOS 7+, so the `precomposed` keyword no longer brings
    much benefit (as of iOS 7, no special effects are applied to
    touch icons).

  * Adding `<link rel="apple-touch-icon" ...>` in `index.html`
    will also allow⁵ (some of) the default Android 2.2+ browsers
    to use the touch icon.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

¹ h5bp/html5-boilerplate#1615

² https://mathiasbynens.be/notes/touch-icons
  https://developer.apple.com/library/ios/documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html

³ https://code.google.com/p/chromium/issues/detail?id=259681
  h5bp/html5-boilerplate#1615

⁴ According to Apple (as measured by the App Store on October 13, 2014):

    * 5%  iOS < 7
    * 47% iOS 7
    * 48% iOS 8

  From: https://developer.apple.com/support/appstore/
        https://cloud.githubusercontent.com/assets/1223565/4720999/2aa8ba26-5935-11e4-9492-92ff6a50ad7d.pnghttp://www.ravelrumba.com/blog/android-apple-touch-icon/

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Close h5bp/html5-boilerplate#1622
2014-10-22 00:02:26 +03:00
Cătălin Mariș
d7976c3f75 Update Apache Server Configs to v2.10.0 2014-10-20 17:33:02 +03:00
Cătălin Mariș
ad27d2e6b2 Enforce LF newlines also for hidden files 2014-10-20 16:57:18 +03:00
Cătălin Mariș
6f50688c1c Enforce LF newlines
This change is done in order to ensure that Windows users don't
encounter any newline related issues.

e.g.: Prior to this change, after the build script was run, files
from `node_modules` (having `LF` newlines, and which wouldn't have
be normalized by `git`) would be copied to the `dist/` directory
and would appear to Windows users as if they where changed.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Thanks to @XhmikosR for pointing this out!

Ref http://git-scm.com/docs/gitattributes#_effects
    http://en.wikipedia.org/wiki/Newline

Close h5bp/html5-boilerplate#1618
2014-10-15 21:55:01 +03:00
Cătălin Mariș
697fa65431 Replace short links with original links
While the short links look "nicer" and can be useful (e.g.: stats),
when our site (http://h5bp.com) goes down, it prevents users from
accessing the information they point to.

Close h5bp/html5-boilerplate#1619
2014-10-15 16:00:52 +03:00
Cătălin Mariș
695e8d9f82 Update Apache Server Configs to v2.9.0 2014-10-15 15:43:43 +03:00
XhmikosR
c3d52666d0 Remove lint options covered by JSCS from .jshintrc
Ref https://github.com/jscs-dev/node-jscs#rules
Close h5bp/html5-boilerplate#1617
2014-10-14 23:48:19 +03:00
XhmikosR
f2d9182155 Add JSCS JavaScript code style checker to build
Ref https://github.com/jscs-dev/node-jscs#readme
    h5bp/html5-boilerplate#1617
2014-10-14 23:48:09 +03:00
Cătălin Mariș
f3a94f5f6e Separate jQuery URL test into two different tests 2014-10-14 22:18:59 +03:00
XhmikosR
768a15235f Add test to the list of dirs from package.json 2014-10-13 12:57:55 +03:00
H5BP
c9ac4325bb Update content from the dist directory [skip ci] 2014-10-13 08:30:54 +00:00
XhmikosR
9d127a2c82 Add test/tests.js in the JSHint check 2014-10-13 11:26:33 +03:00
XhmikosR
2b69bde024 Make consistency changes in test/tests.js 2014-10-13 11:26:11 +03:00
XhmikosR
80ee26d734 Further losslessly compress images
* apple-touch-icon-precomposed.png

   before:         3962 B
   after:          3959 B
   ──────────────────────
   reduction:         3 B [0.07%]

 * tile.png

   before:         3495 B
   after:          3482 B
   ──────────────────────
   reduction:        13 B [0.37%]

 * tile-wide.png

   before:         1864 B
   after:          1854 B
   ──────────────────────
   reduction:        10 B [0.53%]
2014-10-13 11:26:11 +03:00
H5BP
4b07bb3f8b Update content from the dist directory [skip ci] 2014-10-12 08:30:11 +00:00
Chris Rebert
c2abc3f6e0 Docs: Fix wrong homophone in html.md
Close h5bp/html5-boilerplate#1616
2014-10-12 11:29:14 +03:00
Cătălin Mariș
3d4c3da5d9 Move update_dist_directory.sh into bin/travis
Make it even more clear that the `update_dist_directory.sh`
is intended for Travis¹, and not for the user to run it.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

¹ http://docs.travis-ci.com/
2014-10-12 11:27:31 +03:00
slavanga
f3ecc0c67f Add vertical centering for iframe
Remove gap between the `iframe` elements and the bottom
of their containers by vertically centering them.

Close h5bp/html5-boilerplate#1613
2014-10-11 18:04:31 +03:00
Cătălin Mariș
1cac1c9ecc Docs: Improve info regarding IE's document modes
Ref h5bp/html5-boilerplate#1554
Close h5bp/html5-boilerplate#1446
2014-10-10 14:06:59 +03:00
Cătălin Mariș
f8ee8fec3f Docs: Make minor update regarding touch icons 2014-10-06 19:01:40 +03:00
Andrew Brinker
d5e0625312 Change the outdated browser prompt classname
While the outdated browser prompt currently links to `browsehappy.com`,
users are free and even encouraged to substitute the link with their own
page or site of preference.

This commit changes the `browsehappy` specific classname with the more
agnostic `browserupgrade` in order to make the link substitution
easier, but more importantly to hint to the users that they don't have
to stick with the currently default provided `browsehappy.com` link.

Ref: h5bp/html5-boilerplate#1582
     h5bp/html5-boilerplate#1608

Close h5bp/html5-boilerplate#1608
2014-10-06 12:15:16 +03:00
Cătălin Mariș
c9a5fb4d70 Docs: Make minor correction regarding touch icons
Clarify that the iPad and iPad mini with @1x display running iOS 8 are
also using the `76×76px` touch icon.

Ref: h5bp/html5-boilerplate#1599.
2014-10-06 10:52:26 +03:00
Arthur Verschaeve
7aa92ea5f6 Update to normalize.css v3.0.2
Close h5bp/html5-boilerplate#1609
2014-10-05 17:03:42 +03:00
Cătălin Mariș
d3e9cbfcec Update devDependencies 2014-10-05 16:54:13 +03:00
Cătălin Mariș
66d5b120d6 Update devDependencies 2014-09-28 23:34:19 +03:00
Cătălin Mariș
32c0b2b160 Docs: Use https:// where possible 2014-09-28 14:34:17 +03:00
Cătălin Mariș
1c4fcf3214 Update apple-touch-icon-precomposed.png and docs
* Update the documentation regarding the Apple touch icons, by
   reflecting the recent changes brought by the release of iOS 8 and the
   new iPhone 6 and 6 Plus.

   Note: The changes do not follow all Apple's iOS Human Interface
   Guidelines¹, as in practice, the images used by the different devices
   are different² from the ones specified in the Apple documentation.

 * Update the `apple-touch-icon-precomposed.png` to be `180×180px` (this
   is now the largest image size used by any Apple device running iOS).

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

¹ https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html
² h5bp/html5-boilerplate#1599

Close h5bp/html5-boilerplate#1599.
2014-09-25 11:29:05 +03:00
Arthur Verschaeve
712568f229 Futher optimize tile.png and tile-wide.png
* `tile.png`:

    before:        13743 B
    after:          3495 B
    ──────────────────────
    reduction:     10248 B [74.56%]

 * `tile-wide.png`

    before:         6774 B
    after:          1864 B
    ──────────────────────
    reduction:      4910 B [72.48%]

Close h5bp/html5-boilerplate#1604.
2014-09-22 20:09:01 +03:00
Cătălin Mariș
215bebe5e5 Remove the cross-domain phrase from README.md
The part about `Cross-domain Ajax and Flash` from the `README.md` file
isn't accurate, as by default:

 * the `crossdomain.xml` file doesn't grant a web client — such as Adobe
   Flash Player, Adobe Reader, etc. — permission to handle data across
   multiple domains

 * the Apache server configs, do not allow cross-origin access to all
   resources, unless the user enables that behavior
2014-09-20 17:51:12 +03:00
Cătălin Mariș
f134545b95 Docs: Provide link to Google's docs on robots.txt
Ref: h5bp/html5-boilerplate#1554
2014-09-19 17:56:57 +03:00
Arthur Verschaeve
3e3b770b0d Docs: Add information about the robots.txt file
Ref: h5bp/html5-boilerplate#1554
Close: h5bp/html5-boilerplate#1598
2014-09-19 17:56:24 +03:00
H5BP
a8fabc504b Update content from the dist directory [skip ci] 2014-09-18 20:37:29 +00:00
Chris Rebert
ed6ba6d8ba Docs: Fix typos
Close h5bp/html5-boilerplate#1600
2014-09-18 23:35:25 +03:00
Paul Irish
c35f8d3c2e Update update_dist_directory.sh 2014-09-17 11:45:42 -07:00
H5BP
6cd8083b15 Update content from the dist directory [skip ci] 2014-09-14 07:35:01 +00:00
Arthur Verschaeve
75d6ea62a0 Docs: Fix broken link in misc.md
Close h5bp/html5-boilerplate#1596
2014-09-14 10:33:52 +03:00
Cătălin Mariș
59911a536d Update Apache Server Configs to v2.8.0 2014-09-13 14:06:40 +03:00
H5BP
e830ce22b5 Update content from the dist directory [skip ci] 2014-09-11 17:59:04 +00:00
Arthur Verschaeve
d352b37ac1 Docs: Fix broken link in usage.md
Close h5bp/html5-boilerplate#1595
2014-09-11 20:57:03 +03:00
Cătălin Mariș
77684b1638 Docs: Add info on disabling phone no. formatting
By default Safari on iOS will automatically inject a `<a href="tel:…">`
when it detects any string formatted like a phone number on the web page
(see: https://cloud.githubusercontent.com/assets/1223565/4230929/90243cd8-398a-11e4-9363-67faf5cb355c.png).

This commit improves the documentation by providing information on
how to disable the automatic detection and formatting of possible phone
numbers in Safari on iOS.

Ref: https://twitter.com/marcosc/status/507897299587313665/
     https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html/#//apple_ref/doc/uid/TP40008193-SW5
2014-09-11 12:37:22 +03:00
H5BP
029093fdc4 Update content from the dist directory [skip ci] 2014-09-10 20:02:20 +00:00
Cătălin Mariș
a3baca2367 Make Travis automatically update dist directory
Configure Travis to automatically update the content from the `dist`
directory by executing a script¹ that will regenerate the content from
the `dist` directory and commit any new changes to the `master` branch.

This change will help in the development process by:

  * ensuring that the content from the `dist` directory is always
    in sync with the rest of the content

  * removing the need to execute the build step locally everytime
    a change is made (especially in the case of trivial changes,
    such as, typos)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

¹ The script (`bin/update_dist_directory.sh`) will only be executed
  if the tests pass, and will only run if the changes are made in the
  `master` branch.

See also: http://docs.travis-ci.com/user/encryption-keys/

Close h5bp/html5-boilerplate#1593
2014-09-10 22:59:48 +03:00
QWp6t
93c3ec4480 Docs: Add more info regarding servers and stacks
Ref: h5bp/html5-boilerplate#1572
Close: h5bp/html5-boilerplate#1572
2014-09-10 15:04:40 +03:00
Hans Christian Reinl
a44c533d55 Minor fix: Use short version of shorthand for margin declaration in 404 template 2014-09-01 22:42:25 +02:00
Haller, Christian
176aa951d5 Remove unneeded comma from gulpfile.js
Close h5bp/html5-boilerplate#1591
2014-09-01 14:12:23 +03:00
Cătălin Mariș
2a09bdf3e3 Update the content from the dist directory 2014-08-30 20:30:29 +03:00
Cătălin Mariș
9c03754490 Make Travis CI limit the Git clone depth even more
In order to speed up the tests a little bit more, inform Travis CI
to limit the Git clone depth to 10 commits (default is 50).

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

e.g.:

  $ time g clone --depth 10 git@github.com:h5bp/html5-boilerplate.git
  ...

  real    0m2.636s
  user    0m0.052s
  sys     0m0.040s

  $ time g clone --depth 50 git@github.com:h5bp/html5-boilerplate.git
  ...

  real    0m3.542s
  user    0m0.064s
  sys     0m0.072s

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Ref: http://git-scm.com/docs/git-clone
     https://twitter.com/travisci/status/288390896339267584
2014-08-30 20:30:23 +03:00
Antoine Leblanc
927df9df01 Docs: Update icon size for Chrome Mobile web apps
The recommended size for the icon that Chrome Mobile uses to
install to the homescreen was recently changed to 192×192px.

Ref: https://developer.chrome.com/multidevice/android/installtohomescreen#icon
     h5bp/html5-boilerplate#1587

Close: h5bp/html5-boilerplate#1587
2014-08-28 08:35:10 +03:00
Arthur Verschaeve
77d43a3d5d Fix typo in gulpfile.js
Close h5bp/html5-boilerplate#1586.
2014-08-27 18:13:06 +03:00
Grant
fccfbbbbdc Add pseudo-elements to universal selector in print media query
The pseudo-elements `:before` and `:after` are not targeted by the
universal `*` selector. When the page is printed the CSS properties of
any pseudo-elements will only be overridden if they are being inherited
from their selector. Any styles that have been defined directly on a
pseudo-element are unaffected.

Closes #1585.
2014-08-27 15:24:45 +02:00
Cătălin Mariș
268611e33a Fix Modernizr path in index.html
Thanks @juukie14.
2014-08-18 14:29:09 +03:00
Thomas Krug
287f12229e Update to Modernizr 2.8.3
Close h5bp/html5-boilerplate#1580.
2014-08-15 09:14:23 +03:00
Cătălin Mariș
954eef1b1e Allow Travis to send email notifications
Travis has a pretty decent default behavior when it comes to sending
email notifications.

Ref: http://docs.travis-ci.com/user/notifications/#Email-notifications
2014-08-06 01:40:11 +03:00
Cătălin Mariș
641586aaca Include gulpfile.js to be run through JSHint 2014-08-05 16:27:36 +03:00
Will
3928548dc4 Update gulpfile to use del instead of gulp-rimraf
Ref: robrich/gulp-rimraf#14
Close: h5bp/html5-boilerplate#1578
       h5bp/html5-boilerplate#1579
2014-08-05 15:44:42 +03:00
Cătălin Mariș
4b779d3ed9 Fix link in README.md 2014-08-04 19:29:59 +03:00
Cătălin Mariș
c73ae71db4 Add badges
* Add Travis CI status icon.
  http://docs.travis-ci.com/user/status-images/

* Add `devDependencies` status icon.
  https://david-dm.org/
2014-08-04 19:02:40 +03:00
Cătălin Mariș
2bf27eb108 Add dist/ directory
The `dist/` directory is added in order to allow even less experienced
users (users that may not want to deal with the build script) to get
the latest changes, namely, what is in the `master` branch, but is not
yet released.
2014-08-04 19:02:40 +03:00
Cătălin Mariș
9318c6321a Change project architecture
* Move all the H5BP source files into the `src/` directory and remove
  all external components that can be fetch via `npm`, namely: the
  Apache Server Configs, jQuery, and Normalize.css.

* Add `package.json`, and move to using `npm` for managing dependencies
  (for more information about `npm`, see: https://www.npmjs.org/doc/).

* Add `gulp` based build script to allows us to automatically create
  the distribution files as well as an archive that can then be attached
  to the release - https://github.com/blog/1547-release-your-software
  (for more information about gulp, see: http://gulpjs.com/).

* Add other miscellaneous files to help us in our development process:

   * `.editorconfig` - to define and maintain consistent coding styles
                       http://editorconfig.org/

   * `.jshintrc`     - to specify JSHint configuration options
                       http://www.jshint.com/docs/

   * `.travis.yml`   - to specify Travis CI configuration options
                       http://docs.travis-ci.com/

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

These changes:

  * automate some of the tedious work (e.g.: updating the external
    components, updating some of the inline content such as version
    numbers, etc.)

  * will allow us to experiment more (e.g.: allow us to create different
    builds of H5BP, builds that can contain different components)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Ref h5bp/html5-boilerplate#1563
Close h5bp/html5-boilerplate#1563
2014-08-04 19:02:30 +03:00
Arthur Verschaeve
da7bf0d530 Make minor correction in README.md
Close h5bp/html5-boilerplate#1576.
2014-08-02 13:03:29 +03:00
Evgeny Orekhov
c3a72ff882 Remove need to readjust margins in 404.html
Since some of the users prefer to just modify the placeholder 404
page instead of replacing it with their own, this commit makes it
easier to do that by allowing them to modify the content without
worrying about readjusting the margins.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Note: The different in size compared to the old 404 is negligible:

 * old 404:

   original size:         1242 B
   gzipped size:           574 B

 * new 404:

   original size:         1274 B
   gzipped size:           570 B

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Ref: h5bp/html5-boilerplate#1567.
Close: h5bp/html5-boilerplate#1567.
2014-07-31 21:28:49 +03:00
Arthur Verschaeve
8ef199adf6 Docs: Add information about PHP's built-in server
Ref: http://php.net/manual/en/features.commandline.webserver.php
Close: h5bp/html5-boilerplate#1569.
2014-07-29 14:34:37 +03:00
Cătălin Mariș
ef48601262 Update to Apache Server Configs 2.7.0 2014-07-28 04:28:43 +03:00
₍˄ุ.͡˳̫.˄ุ₎
c3d967ab25 Docs: Remove gendered pronoun from faq.md
Close: h5bp/html5-boilerplate#1566.
2014-07-27 12:41:58 +03:00
Cătălin Mariș
3c3c5e6460 Docs: Remove minimal-ui related information
The `minimal-ui` viewport property was introduced in iOS 7.1,
but it will no longer be supported in iOS 8.

Ref: https://developer.apple.com/library/prerelease/ios/releasenotes/General/RN-iOSSDK-8.0/#//apple_ref/doc/uid/TP40014223-CH1-SW83
Close: h5bp/html5-boilerplate#1565
2014-07-23 01:55:04 +03:00
Jonathan Neal
a99d8563dd Add /.editorconfig file
The addition of the `/.editorconfig` file is made in order to
encourage and help developers and their teams define and maintain
consistent coding styles between their different editors and IDEs.

By default, `/.editorconfig` includes some basic properties that
reflect the coding styles from the files provided by default, but
users can easily change them to better suit their needs.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Since users need to install a editor/IDE plugin in order for the
properties from the `/.editorconfig` to be applied, we were reluctant
to add this file in the past (see: h5bp/html5-boilerplate#1124).
Nowadays however, the EditorConfig project provides plugins for most
of the popular editors/IDEs (see: http://editorconfig.org/#download),
plus, more and more developers are using it.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Ref: http://editorconfig.org/

Close: h5bp/html5-boilerplate#1561
       h5bp/html5-boilerplate#1564
2014-07-21 23:08:02 +03:00
Cătălin Mariș
973b8453de Docs: Make minor improvments in html.md 2014-07-19 03:35:08 +03:00
Philip Walton
4fca586fae Add auto to the GA tracker create method
The Google Universal Analytics now supports automatic cookie domain
configuration simply by adding `auto` to the analytics tracker create
method: `ga('create', 'UA-XXXX-Y', 'auto');`.

From https://developers.google.com/analytics/devguides/collection/analyticsjs/domains#auto:

  "Automatic Cookie Domain Configuration simplifies cross domain
   tracking implementations by automatically writing cookies to the
   highest level domain possible when the auto parameter is used.
   When used on the domain www.example.co.uk, it will try to write
   cookies in the following order:

     1. co.uk
     2. example.co.uk
     3. www.example.co.uk

   Analytics.js will fail to write a cookie on co.uk but will succeed
   on example.co.uk. Since a cookie was succesfully written on a higher
   level domain, www.example.co.uk will be skipped"

So, when this parameter is omitted (as it was prior to this commit),
Google Universal Analytics will default to using `location.hostname`,
which will include the subdomain, preventing websites with multiple
subdomains from being able to automatically track unique users across
those subdomains.

Note: The `auto` parameter is now officially part of the recommended
Google Universal Analytics snippet.
https://developers.google.com/analytics/devguides/collection/analyticsjs/

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Ref: https://developers.google.com/analytics/devguides/collection/analyticsjs/domains#auto
Close: h5bp/html5-boilerplate#1562.
2014-07-17 15:20:12 +03:00
ltodorov
8daaa56023 Add timeline & timelineEnd in plugins.js
In Chrome and Opera the console object now includes two new methods:

 * `timeline`
    https://developer.chrome.com/devtools/docs/console-api#consoletimelinelabel

 * `timelineEnd`
    https://developer.chrome.com/devtools/docs/console-api#consoletimestamplabel

Close: h5bp/html5-boilerplate#1559.
2014-07-11 22:39:37 +03:00
Arthur Verschaeve
5027eeaab2 Docs: Update info from js.md regarding plugins.js
Add information about the script from the `plugins.js` file.

Ref   h5bp/html5-boilerplate#1554
Close h5bp/html5-boilerplate#1558
2014-07-11 18:00:34 +03:00
Arthur Verschaeve
ff27f8c563 Docs: Add basic info about .htaccess in misc.md
Ref   h5bp/html5-boilerplate#1554
Close h5bp/html5-boilerplate#1557
2014-07-10 13:15:57 +03:00
Cătălin Mariș
8935453014 Docs: Update jQuery CDN related info from faq.md
Update documentation to include the information from the recent
jQuery team announcement:

   "To mitigate the risk of “breaking the web”, the jQuery team
    decided back in 2013 that jquery-latest.js could not be
    upgraded to the 2.0 branch even though that is technically
    the latest version. There would just be too many sites that
    would mysteriously stop working with older versions of Internet
    Explorer, and many of those sites may not be maintained today.

    As jQuery adoption has continued to grow, even that safeguard
    seems insufficient to protect against careless use of
    http://code.jquery.com/jquery-latest.js. So we have decided to
    stop updating this file, as well as the minified copy, keeping
    both files at version 1.11.1 forever ...

    The Google CDN team has joined us in this effort to prevent
    inadvertent web breakage and no longer updates the file at
    http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js. That
    file will stay locked at version 1.11.1 as well."

   (from: http://blog.jquery.com/2014/07/03/dont-use-jquery-latest-js/)

Ref: h5bp/html5-boilerplate#1554
2014-07-05 17:48:11 +03:00
Cătălin Mariș
1c5be4d307 Update to Apache Server Configs 2.6.0
Changelog: 155b0b68c0/CHANGELOG.md (260-july-3-2014).
2014-07-03 20:29:57 +03:00
Cătălin Mariș
0443e50892 Docs: Update and improve css.md 2014-07-01 00:18:55 +03:00
Cătălin Mariș
0efb9fb4df Docs: Update and improve TOC.md
* Make minor updates and improvements.
* Remove `.htaccess` mention as the Apache server configs are no longer
  part of the HTML5 Boilerplate core, plus, more information about them
  will be included in the `misc.md` file.
2014-06-28 00:52:55 +03:00
Cătălin Mariș
296b0bbf25 Docs: Update and improve faq.md 2014-06-25 00:08:04 +03:00
Cătălin Mariș
3220cf1d63 Docs: Move crossdomain.xml info into misc.md
Update and improve the `crossdomain.xml` related documentation,
as well as move it into the `misc.md` file.

The move is made in order to be more consistent (we don't have
special pages for any of the other "miscellaneous" files).
2014-06-24 23:52:35 +03:00
Cătălin Mariș
d2b86f78a4 Mention Apache Server Configs in humans.txt
The Apache server configs have evolved into their own separate
project, and thus, they are now considered an external component.
2014-06-24 21:02:44 +03:00
Cătălin Mariș
5e0b0d642b Update links 2014-06-21 03:18:30 +03:00
Cătălin Mariș
8c4b71e6c6 Update to Apache Server Configs 2.5.0 2014-06-14 14:00:37 +03:00
Ismay
a82c61fb3e Docs: Update content regarding Google Analytics
* Explain the reason for providing the Google Universal Analytics
  snippet by default.

* Make it more clear that users are encouraged to use whatever
  tracking solution suits their needs best.

Ref h5bp/html5-boilerplate#1547
Close h5bp/html5-boilerplate#1548
2014-06-13 01:17:30 +03:00
Cătălin Mariș
261f8dd398 Update to Apache Server Configs v2.4.1 2014-06-07 00:33:09 +03:00
Cătălin Mariș
d916a72025 Add lang="" to <html>
In the past we decided¹ to remove the `lang` attribute due to the fact
that developers were often forgetting to update its value. This change
turned out not to be the best solution because some of the users:

 * didn't read the documentation, and thus, they found the absence
   of the `lang` attribute confusing, or didn't even knew they had
   to add it

 * didn't notice the absence of the `lang` attribute, and thus, forgot
   to include it (expecting it to be there)

To make things more clearer and to remind users that they need to
specify the primary language of the document, this commit reintroduces
the `lang` attribute, while leaving its value to `""`.

Using `lang=""` has the exact same effect as not specifying the `lang`
attribute at all, in both cases the language being treated as unknown².

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

¹ https://github.com/h5bp/html5-boilerplate/issues/1110
² From WHATWG (http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#attr-lang):

  "To determine the language of a node, user agents must look at the
   nearest ancestor element (including the element itself if the node
   is an element) that has a lang attribute in the XML namespace set
   or is an HTML element and has a lang in no namespace attribute set.
   That attribute specifies the language of the node (regardless of
   its value).

   If both the lang attribute in no namespace and the lang attribute
   in the XML namespace are set on an element, user agents must use
   the lang attribute in the XML namespace, and the lang attribute in
   no namespace must be ignored for the purposes of determining the
   element's language.

   If neither the node nor any of the node's ancestors, including the
   root element, have either attribute set, but there is a pragma-set
   default language set, then that is the language of the node. If there
   is no pragma-set default language set, then language information from
   a higher-level protocol (such as HTTP), if any, must be used as the
   final fallback language instead. In the absence of any such language
   information, and in cases where the higher-level protocol reports
   multiple languages, the language of the node is unknown, and the
   corresponding language tag is the empty string.

   If the resulting value is not a recognized language tag, then it
   must be treated as an unknown language having the given language tag,
   distinct from all other languages."

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Close h5bp/html5-boilerplate#1542.
2014-05-13 22:51:29 +03:00
Cătălin Mariș
c0ea65101a Update to jQuery 1.11.1
See also: http://blog.jquery.com/2014/05/01/jquery-1-11-1-and-2-1-1-released/

Close h5bp/html5-boilerplate#1535.
2014-05-13 08:26:05 +03:00
Cătălin Mariș
11262ec742 Update CONTRIBUTING.md
* Remove extra `the`.
* Remove IRC reference as it does not help the user in
  any way, plus, we don't have an official IRC channel.
2014-05-09 20:07:09 +03:00
Mateusz Jagiełło
2d443d853f Remove empty line from main.js
Close h5bp/html5-boilerplate#1538.
2014-05-03 19:18:14 +03:00
Mateusz Jagiełło
f067d5eec5 Fix file system permissions for normalize.css
Close #1537.
2014-05-03 17:16:29 +03:00
Cătălin Mariș
2e8a977d2c Update print related comments in main.css file
Use correct terminology and remove the outdated parts of the comments.

See also:

 * JavaScript URIs:
   https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/void#JavaScript_URIs

 * URL fragments:
   http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#scroll-to-fragid

 * `href` attribute:
   http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#attr-link-href
   https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-href
2014-05-01 12:48:36 +03:00
Cătălin Mariș
e12fc689a5 Add newline at the end of the gitattributes file
Under UNIX-like OSes, a text file consists of a series of lines, each
of which ends with a `newline` character (`\n`). A file that is not
empty and does not end with a `newline` is therefore considered not to
be a text file.

Because of this, utilities that are supposed to operate on text files
may not cope well with files that don't end with a `newline` (e.g.: they
might ignore the text after the last `newline`).

Adding the `newline` character at the end of the file ensures that users
won't encounter any odd behavior when using it.

Reference/Source: http://unix.stackexchange.com/a/18789.
2014-05-01 01:16:07 +03:00
Hans Christian Reinl
41b9f1a36a Update to Modernizr v2.8.0 2014-04-29 23:23:01 +02:00
XhmikosR
dcc5958a39 Further optimize tile images
* tile.png

     before:        13767 B
     after:         13743 B
     ──────────────────────
     reduction:        24 B [0.17%]

 * tile-wide.png

     before:         6781 B
     after:          6774 B
     ──────────────────────
     reduction:         7 B [0.10%]
2014-04-27 11:53:31 +03:00
Cătălin Mariș
d01c26fd13 Make inline comments from main.css more consistent 2014-04-25 14:46:32 +03:00
Cătălin Mariș
861c359e40 Update to Apache Server Configs v2.3.0 2014-04-10 11:05:21 +03:00
Cătălin Mariș
e67e9cc7c1 Use <!doctype html> instead of <!DOCTYPE html>
Return back to the lowercase doctype in order to be more consistent
with the lowercase of the html tags.

References:

  * h5bp/html5-boilerplate#1522
  * http://www.whatwg.org/specs/web-apps/current-work/multipage/syntax.html#the-doctype

Close h5bp/html5-boilerplate#1522.
2014-04-02 12:32:49 +03:00
Cătălin Mariș
06b4df40e2 Update to Normalize.css 3.0.1 2014-03-28 08:22:55 +02:00
Alastair Hole
ee0de7541f Docs: Make minor grammar change in extend.md
Close h5bp/html5-boilerplate#1517.
2014-03-13 19:55:17 +02:00
Tom Fuertes
7997c1b9a1 Docs: Update content regarding Google Analytics
Close: h5bp/html5-boilerplate#1490
       h5bp/html5-boilerplate#1515
2014-03-02 09:41:57 +02:00
Cătălin Mariș
dea7690774 Update CHANGELOG.md
Include missing reference.
2014-02-25 22:13:17 +02:00
Rob Larsen
f639653d3d Docs: Improve content about use of CDN for jQuery
Ref: https://github.com/h5bp/html5-boilerplate/issues/1498#issuecomment-33163993.
Close: #1511, #1514.
2014-02-25 09:48:00 +02:00
XhmikosR
106bb43c37 Docs: Fix typo in extend.md
Close #1510.
2014-02-23 13:49:57 +02:00
Cătălin Mariș
4d7ba31ada Docs: Use Bootstrap instead of "Twitter Bootstrap"
"Twitter Bootstrap" is now simply known as "Bootstrap".

Ref: http://getbootstrap.com/about/#brand

Thanks @cvrebert.
2014-02-23 13:46:07 +02:00
Cătălin Mariș
80530d6b46 Add /browserconfig.xml and tile images
By default, starting with IE11 on Windows 8.1, IE will request the
`/browserconfig.xml` file when a user clicks/touches the `pin site`
button (same as Safari for iOS does with the `apple-touch-icons` when
the user touches the `share` button).

Adding the `/browserconfig.xml` file and the tile images:

* reduces the number of 404s, especially as IE11 on Windows 8.1 gets
  more market share
* provides a starting point for dealing with Windows tiles
* reminds users about the tile images, so that their website doesn't
  end up having as a tile the default IE11 logo, or (if the favicon
  is 32×32px or bigger and not `.ico`) the website's favicon
* unlike using `<meta>` tags, offers a way that doesn't increase the
  page size

Only two images are provided since:

* `tile.png` (558×558px) - can be used for the `Small`, `Medium`,
  and `Large` tiles, being automatically resized where necessary
* `tile-wide.png` (558×270px) - can be used for the `Wide` tile
  as, in this case, resizing the 558×558px image would just end up
  looking weird

The two images are 558×558px and 558×270px because those are the
recommended image sizes in order for the tiles to look good on a wide
range of devices.

For more in depth information, please refer to the MSDN documentation:

 * http://msdn.microsoft.com/en-us/library/ie/dn455106.aspx
 * http://msdn.microsoft.com/en-us/library/ie/dn255024.aspx

Close #1481.
2014-02-19 00:12:39 +02:00
Cătălin Mariș
f73bb1f614 Update to Apache Server Configs 2.2.0 2014-02-03 11:16:28 +02:00
Cătălin Mariș
ab0a9ea391 Make consistency changes
Change code indentation in `normalize.css` from 2 to 4 spaces. This
is done in order to be consistent with the indentation used in the
other files.
2014-02-01 12:33:26 +02:00
Abhinay Rathore
cacfa08050 Docs: Add Separate mobile URLs subsection
Inform users that, if they use separate URLs for desktop and mobile
users, they should consider helping search engine algorithms better
understand the configuration on their web site.

See also:

 * https://developers.google.com/webmasters/smartphone-sites/details#separateurls
 * https://developers.google.com/webmasters/smartphone-sites/feature-phones

Close #1504.
2014-02-01 12:16:39 +02:00
Cătălin Mariș
e70ee31d2b Update to jQuery 1.11.0
Close #1499.
2014-01-29 22:50:49 +02:00
Cătălin Mariș
185b730edd Update CHANGELOG.md 2014-01-29 22:44:48 +02:00
Nicolas Gallagher
3c216951d4 Update to Normalize.css 3.0.0 2014-01-28 14:40:30 -08:00
Cătălin Mariș
f5d58728e1 Further optimize apple-touch-icon-precomposed
before:         1226 B
  after:          1076 B
  ──────────────────────
  reduction:      -150 B [-12.23%]
2014-01-27 22:36:58 +02:00
Cătălin Mariș
4e5f438e1e Add Disallow: to robots.txt
The addition of `Disallow:` is made in order to be compliant with:

  * the `robots.txt` specification (http://www.robotstxt.org/), which
    specifies that: "At least one Disallow field needs to be present
    in a record"
  * what is suggested in the documentation of most of the major search
    engines, e.g.:

      - Baidu:  http://www.baidu.com/search/robots_english.html
      - Google: https://developers.google.com/webmasters/control-crawl-index/docs/getting_started
                http://www.youtube.com/watch?v=P7GY1fE5JQQ
      - Yandex: help.yandex.com/webmaster/controlling-robot/robots-txt.xml

Besides the addition specified above, this commit also:

  * adds a comment making it clear to everyone that the directives from
    the `robots.txt` file allow all content on the site to be crawled
  * updates the URL to `www.robotstxt.org`, as `robotstxt.org` doesn't
    quite work:

      curl -LsS robotstxt.org
      curl: (7) Failed connect to robotstxt.org:80; Operation timed out

Close #1487.
2014-01-15 22:14:06 +02:00
David Alexander
a20a3c76d5 Combine the html selectors into one rule
Close #1492.
2014-01-14 23:36:27 +02:00
Cătălin Mariș
76d3021d19 Docs: Update the Apple Touch Icons section
* Add note about `precomposed` not being required anymore, as starting
  with iOS 7, no special effects are applied to the touch icons.

* Add missing touch icon sizes.

Close #1488
2014-01-10 21:15:04 +02:00
Cătălin Mariș
0a04171137 Update to Apache Server Configs v2.1.0 2014-01-07 10:32:55 +02:00
Cătălin Mariș
3da500d5e5 Update 404.html
* Link to a more official page for the information regarding Internet
  Explorer's "friendly HTTP error pages", namely:
  http://blogs.msdn.com/b/ieinternals/archive/2010/08/19/http-error-pages-in-internet-explorer.aspx.

* Remove the indentation for the `<head>` and `<body>` tags in order
  to reduce the file size even closer to the 512 bytes limit. This is
  particularly helpful when compression is not enabled.

* Stats:

  - before:

     original size:         1409 B
     gzipped size:           580 B
     ─────────────────────────────
     reduction:              829 B [58.8%]

  - after:

     original size:         1242 B
     gzipped size:           580 B
     ─────────────────────────────
     reduction:              662 B [53.3%]

Ref: #1443.
2014-01-07 10:28:19 +02:00
timmytofu
1c4df2aa07 Remove default foreground color from form elements
Specifying a default foreground color for the form elements can be
problematic when users (often with visual impairments) use a darker
OS/browser theme. Also, the color set on the form elements is quite
opinionated, so developers tend to change it anyway.

Ref: #1390.
Close: #1390.
2013-12-29 21:18:19 +02:00
Hans Christian Reinl
a557ea0513 Docs: Add note about Chrome Mobile web apps
"Add to Homescreen" feature in Chrome Mobile

Closes #1441.
2013-12-26 13:42:34 +01:00
Cătălin Mariș
57be193031 Remove default margin from print styles
Providing a default value (such as `5cm`) for the print margins is
problematic because:

 1) in some browsers, it prevents users from customizing the browser
    print settings
 2) in some contexts (browser/os/printer), the value may be too:
    * small, and the margins may collide with all the different
      headers/footers (URL, date, etc) that are usually printed
      by default
    * big, and the margins will just waste the space

Most browsers provide a default non-zero value for the print margins,
so it's better to not specify a value at all, and just let them handle
this themselves.

See also:

 * http://www.w3.org/TR/css3-page/#at-page-rule
 * https://developer.mozilla.org/en-US/docs/Web/CSS/@page

Close #1477.
2013-12-25 02:10:15 +02:00
Cătălin Mariș
34c7fbde74 Update CHANGELOG.md
* Include missing references.
* Improve consistency.
* Wrap text at 80 characters.
2013-12-23 11:47:13 +02:00
Connor McSheffrey
f4a2cbfcad Docs: Add note about iOS 7.1 minimal-ui property
Ref: #1485.
Close: #1485.
2013-12-20 13:13:30 +02:00
Cătălin Mariș
df2306766e Docs: Make minor improvements in extend.md
* Wrap text at 80 characters.
* Rephrase content from the `Apple Touch Icons` section to limit subject
  to only `apple-touch-icon`s (ref: #1486).
* Other improvements.
2013-12-20 12:56:49 +02:00
Hans Christian Reinl
15b5cb1b5c Docs: Add comment about lang attribute on <html>
We don't set a default `lang` attribute on `<html>` due to the
discussion in #1110. This commit adds a note about how to set it.

Close #1483.
2013-12-20 12:05:33 +02:00
Anselm Hannemann
d592953e7a Clarify the default of only 2 icons
In extend.md, which is linked as source for 'more details' on the
touch-icons and favicon, this commit clarifies that by default two
icons are enough if one doesn't want to use art-direction.
2013-12-19 22:47:51 +01:00
Hans Christian Reinl
49e4569d02 Docs: Add anchor for MDN link to meta charset 2013-12-15 22:03:01 +01:00
David Walsh
24420747fd Docs: Update MDN link paths 2013-12-15 22:00:24 +01:00
Felix
ec49630374 README.md: Add link to the list of releases
Close #1480.
2013-12-12 00:01:33 +02:00
Cătălin Mariș
9fab0f9990 Update .htaccess file 2013-12-11 23:50:35 +02:00
Hans Christian Reinl
73ea9a5e68 Update Modernizr to v2.7.1 2013-12-03 10:31:38 +01:00
Cătălin Mariș
fbffd2322d Docs: Update links and reorganize extend.md
* Update various links.
* Remove link to the `Node build script` repository as the project is no
  longer maintained.
* Better organize the information provided in `extend.md` by rearranging
  the sections alphabetically by title, and including a table of content
  for faster navigation.
2013-11-19 16:22:16 +02:00
Cătălin Mariș
ca1ced9654 Docs: Update server configs links
* Replace links to the Apache Server Configs `doc`
  directory, as it no longer exists:
  4f778c4a22.

* Provide missing links under the `X-UA-Compatible`
  section in the `html.md` file.
2013-11-19 10:56:54 +02:00
Hans Christian Reinl
f1a8e914be Remove image replacement helper class .ir
This class was removed because it doesn't provide enough use
cases within modern web development. Cases are mostly handled
indiviually by developers.

Reference #1472.
Closes #1475.
2013-11-18 23:39:22 +01:00
Rob Larsen
94c3540ce6 Update to Modernizr 2.7.0 2013-11-18 09:01:34 +01:00
Cătălin Mariș
96d7c99762 Update to Apache Server Configs v2.0.0 2013-11-12 13:32:32 +02:00
Cătălin Mariș
e039cf4275 Remove phrase about IE conditional classes 2013-11-12 13:30:57 +02:00
Jeffrey Godwyll
87274cb181 Fix typo in doc/css.md 2013-11-03 16:13:35 -08:00
Joseph Jaber
3f91469e7f Fix typo in header of doc/html.md (promt → prompt)
Close #1459.
2013-11-01 10:51:34 +02:00
Cătălin Mariș
5e090e0db5 Add note about legacy browser support in v4
Close #1050.
2013-10-21 21:37:53 +03:00
Cătălin Mariș
dc752d7952 Docs: Remove outdated info on Skype highlighting
The snippet provided in the docs about how to prevent the Skype
plugin from formatting numbers on a web pages is outdated and no
longer works.

Nowadays, the Skype plugin makes it more difficult to overwrite
its injected styles (class names include timestamps, e.g.:
`skype_pnh_print_container_1381964168`, `!important` is used, etc.).

Providing a solution for this use case isn't viable. Also, users
that install such a plugin usually expect the behavior.

Close #1454.
2013-10-17 18:21:29 +03:00
Benoît Chantre
8565264a4d Add vertical centering for svg
Remove gap between the `svg` elements and the bottom of their containers
by vertically centering them.

Ref #1326.
Close #1453.
2013-10-16 00:10:51 +03:00
Cătălin Mariș
782aefab7e Redesign 404 page
Changes:

* simplify the overall design
* remove the Google search functionality as in most cases, it does not
  provide much value
* reduce the overall file size while keeping the gzipped size over 512
  bytes to prevent IE from displaying its own custom error page (thanks
  @mikealmond and @patrickkettner):
  http://www.404-error-page.com/404-error-page-too-short-problem-microsoft-ie.shtml

Benefits include:

* small file size (1409 bytes / 580 bytes gzipped), which is particular-
  ly useful when users are on a data plan and / or the server is wrongly
  configured (e.g.: tries to redirect to a "mobile" version of the web
  page and ends up serving a 404 page) or developers forget to provide
  certain files (e.g.: /favicon.ico -
  http://zoompf.com/blog/2012/04/instagram-and-optimizing-favicons)
* improved performance (less HTTP requests, less memory consumption,
  faster rendering, etc.)
* designed to work with all kinds of screen sizes and support IE 6+

Close #1443.
2013-10-12 22:54:14 +03:00
Cătălin Mariș
6d10fc8cce Docs: Add info about how to block Google Translate
Inform users on how to disable the translation prompt in Chrome or
block Google Translate from translating a web page or any particular
section of the web page.

See also: https://support.google.com/translate/?hl=en#2641276.

Close: #1440.
2013-10-03 21:29:02 +03:00
Oskar S. Jakieła
f07a80011b Fix comment in index.html about apple-touch-icons
Close #1438.
2013-09-29 12:04:53 +03:00
Cătălin Mariș
18d3a9dd9e Update documentation and README.md
Remove content regarding legacy browsers.

Ref: #1050.
2013-09-29 12:01:42 +03:00
Cătălin Mariș
b96191e590 Show outdated browser prompt to IE 6 and 7 users
Ref: #1050.
2013-09-24 20:19:08 +03:00
Nicolas Gallagher
afaed48700 Remove IE 6/7 hacks from main.css
Ref: #1050.
2013-09-24 09:30:20 -07:00
Cătălin Mariș
b7208f1e01 Update to normalize.css v2.1.3
Ref: #1050.
2013-09-24 15:33:08 +03:00
Cătălin Mariș
13f17a737a Remove IE conditional classes
The reasons behind this decision include the following:

* This project will drop legacy browser support (see #1050), therefore,
  the use for conditional classes for IE 8+, becomes much more limited.
* IE 10+ does not support conditional comments:
  http://msdn.microsoft.com/en-us/library/ms537512%28v=VS.85%29.aspx.
* Users do and can develop easily without using the conditional
  classes, this technique being very limited in scope as no other
  browser versions are explicitly target in the same way.
* It fixes the issue that prevents IE from honouring
  `<meta http-equiv="X-UA-Compatible" content="IE=edge">` (see: #1187).

This change also removes the related documentation.

Close #1290 and #1187.
2013-09-24 11:38:05 +03:00
Hans Christian Reinl
fdbff109c9 Remove notes about Google Chrome Frame from docs
Currently we don't use Google Chrome Frame anymore as support for
it will end at the end of the year.
This commit removes references to Chrome Frame within the
documentation. It is related to 2cf1ef7.

Reference #1433.
2013-09-20 16:18:55 +02:00
Hans Christian Reinl
72cdf1e96c v4.3.0 2013-09-10 21:33:07 +02:00
Cătălin Mariș
f033325bac Update CHANGELOG
Include all changes that are not yet mentioned in the `CHANGELOG.md`.
0adda79fee...d144341003
2013-09-10 22:24:36 +03:00
Cătălin Mariș
d144341003 Add version & license info in .htaccess / main.css
Make it easier for people to know what version of the `.htaccess`
and `main.css` files they are using and under what license these
are provided, by adding this information within the files.

This is useful primarily when developers only copy these files from
the HTML5 Boilerplate project, forget to update their project's change
log or simply do not use anything similar to a change log.

Fix h5bp/html5-boilerplate#1424.
2013-09-10 20:24:31 +03:00
Hans Christian Reinl
71ca9fb7a0 Use one apple-touch-icon instead of six
This commit removes five Apple Touch Icons with different sizes for
the same icon and adds a new icon `apple-touch-icon-precomposed.png`
with a resolution of 152×152px.
Apart from that it adds documentation on how to add more icons if
you need them within your project.
Using only one Apple Touch Icon saves time and is enough in most
cases.

Closes #1367.
Closes #1425.
2013-09-04 14:09:47 +02:00
Hans Christian Reinl
23f5e084e5 Update normalize.css to v1.1.3 2013-08-30 10:14:08 +02:00
Nicolas Gallagher
da9528e568 Update CHANGELOG 2013-08-25 23:58:18 -07:00
Rob Wierzbowski
ab6b2fc4aa Move font-related base declarations to html 2013-08-25 23:55:11 -07:00
XhmikosR
ab05d000f8 Compress .png files losslessly
Use `zopfli-png` with 1000 iterations, `pngout /r` with various block sizes and deflopt.

apple-touch-icon-114x114-precomposed.png | Bin 865 -> 751 bytes
apple-touch-icon-144x144-precomposed.png | Bin 947 -> 939 bytes
apple-touch-icon-57x57-precomposed.png   | Bin 495 -> 450 bytes
apple-touch-icon-72x72-precomposed.png   | Bin 575 -> 512 bytes
apple-touch-icon-precomposed.png         | Bin 495 -> 450 bytes
apple-touch-icon.png                     | Bin 495 -> 450 bytes

The total difference is -320 bytes.

Closes #1418.
2013-08-16 11:20:24 +02:00
Roland Warmerdam
8a68443746 Docs: Update the Track JS errors in GA section
Add column number parameter to the example to reflect the recent changes
in the specification and in the Chrome and IE 10 implementations.

http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#errorevent
https://code.google.com/p/chromium/issues/detail?id=264197

Close #1417.
2013-08-15 13:31:35 +03:00
Pere Orga
cd981e52f7 Further optimize the apple touch icons
Reduce the total size of the icons by 172 bytes using zopfli.

Close #1415.
2013-08-15 09:19:45 +03:00
Hans Christian Reinl
2cf1ef7cea Docs: Update section about the X-UA-Compatible meta option
Chrome Frame is not supported anymore and we removed the option in
8fc2650.
This commit removes the documentation about Chrome Frame in the
X-UA-Compatible meta tag docs.

Related to #1396.
2013-08-14 14:30:49 +02:00
Cătălin Mariș
5bc2a985c7 Docs: Update .htaccess related info and links 2013-08-01 19:24:27 +03:00
Cătălin Mariș
21c614849a Update to Apache Server Configs v1.1.0 2013-08-01 14:35:05 +03:00
Cătălin Mariș
01624d71f5 Update CONTRIBUTING.md
* Reflect the recent changes in @necolas's Issue Guidelines:
  https://github.com/necolas/issue-guidelines.
* Add note about not opening issues and pull requests regarding the code
  in the Apache Server Configs, jQuery, Modernizr and Normalize.css.
2013-08-01 14:23:22 +03:00
Sindre Sorhus
be4484add0 Further optimize the apple touch icons
Reduce the total size of the icons by 1.7KB using ImageAlpha
(16 colors - no visible difference) and ImageOptim.

Close #1406.
2013-07-21 21:37:44 +03:00
bmcustodio
ce7c3c5c15 Updating jQuery to 1.10.2. 2013-07-03 18:40:15 +01:00
Snugug
ff37dba6bf Add initial-scale=1 to meta viewport
iOS 6 fixes the infamous orientation change bug, so a better experience
is provided by reintroducing `initial-scale=1`.
2013-06-30 13:45:20 -07:00
Bommeli
8fc26501f4 Remove Chrome Frame meta tag and HTTP header hints
See also `Retiring Chrome Frame - developer FAQ`:
https://developers.google.com/chrome/chrome-frame/

Close #1396.
2013-06-26 13:56:45 +03:00
Hans Christian Reinl
9ec546569b Add vertical centering for audio-, canvas- and video-tags
Remove the gap between videos, audio and canvas and the bottom of
their containers by vertically centering the tags.

Closes #1326.
2013-06-25 21:42:49 +02:00
Gustavo Rodrigues
02713eedd2 Remove Google Frame message
As said at http://blog.chromium.org/2013/06/retiring-chrome-frame.html Google Frame was retired/obsolete.

Changed "chromeframe" class to "browsehappy"
2013-06-24 13:25:18 -07:00
alrra
8f743702f6 Docs: update information about print styles
Fix: h5bp/html5-boilerplate#1386
2013-06-14 12:03:52 +03:00
Mathias Bynens
48d49e96d6 Update to Google Universal Analytics
This is an optimized version of the official Google Universal Analytics snippet,
based on http://mathiasbynens.be/notes/async-analytics-snippet.
The only difference is that this version still uses
`document.getElementsByTagName('script')[0]` instead of `document.scripts[0]`
for Firefox < 9 support.

Unminified, optimized code:

    (function(window, document, script, variableName, scriptElement, firstScript) {
      window['GoogleAnalyticsObject'] = variableName;
      window[variableName] || (window[variableName] = function() {
        (window[variableName].q = window[variableName].q || []).push(arguments)
      });
      window[variableName].l = +new Date;
      scriptElement = document.createElement(script);
      firstScript = document.getElementsByTagName(script)[0];
      scriptElement.src = '//www.google-analytics.com/analytics.js';
      firstScript.parentNode.insertBefore(scriptElement, firstScript)
    }(window, document, 'script', 'ga'));

    ga('create', 'UA-XXXX-Y');
    ga('send', 'pageview');

Minified:

    (function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;e=o.createElement(i);r=o.getElementsByTagName(i)[0];e.src='//www.google-analytics.com/analytics.js';r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));ga('create','UA-XXXX-Y');ga('send','pageview');

Closes #1347 and #1369.
2013-06-03 19:29:37 +02:00
Hans Christian Reinl
deec362213 Update to jQuery 1.10.1 2013-05-31 21:30:44 +02:00
bmcustodio
713abf57a9 Update to jQuery 1.10.0 2013-05-30 17:00:49 +03:00
Hans Christian Reinl
f27c2b7372 Update to Normalize.css 1.1.2 2013-05-12 13:24:19 +02:00
Hans Christian Reinl
52f17087f9 Add documentation for iOS web applications
Add several options to improve iOS web apps with meta tags when
adding a web page to the Home Screen.

Closes #1352.
2013-05-10 10:48:25 +02:00
alrra
7a22a33d40 Docs: fix broken links 2013-04-12 17:40:55 +03:00
Nicolas Gallagher
0adda79fee v4.2.0 2013-04-07 19:41:59 -07:00
Nicolas Gallagher
d94e506189 Update CHANGELOG 2013-04-07 19:35:51 -07:00
George Gooding
fa7527fb26 Remove Google Analytics protocol check
Google now serves all Analytics scripts via SSL also so the protocol
check is no longer necessary.

Close #1319
2013-04-07 19:33:37 -07:00
Nicolas Gallagher
2a8e5828af Update normalize.css to v1.1.1 2013-04-07 17:40:59 -07:00
alrra
6cfbc95cd6 Docs: replace htaccess.md with link (fix #1344)
Remove `htaccess.md` and link to the Apache `README.md` in
the `server-configs` repository as the documentation for the
configurations is now officially maintained in that repository.
2013-04-01 13:29:14 +03:00
Nicolas Gallagher
a7a4d0685c Fix Grunt link in docs
The repo has moved from 'cowboy/grunt' to 'gruntjs/grunt'.
2013-03-30 17:49:47 -07:00
alrra
c8b0431c7d Import latest .htaccess configurations
Update the Apache configurations to include the
latest changes in the canonical `.htaccess` file.
2013-03-30 11:19:28 +02:00
Nicolas Gallagher
1b0f042e06 Update CHANGELOG 2013-03-04 21:25:20 -08:00
Alfred Xing
a10460934d Fix 404 widget script URL
Fix 404 widget script URL to be compatible with HTTPS by replacing
`http://` with `//`. The script hosted by Google is available on both
protocols.
2013-03-04 09:00:53 -08:00
Drew Noakes
b83ce3b1b4 Fixed typo in main.css 2013-02-17 18:05:40 +02:00
Nicolas Gallagher
c01aa0474d Merge pull request #1313 from impressivewebs/patch-1
Corrected terminology in comment
2013-02-15 21:27:48 -08:00
Louis Lazaris
2f966781d8 Corrected terminology in comment
Really, really nitpicky change here but ... the comment was referring to the selection rule sets as "declarations", which isn't exactly the correct term. See:

http://nimbupani.com/css-vocabulary.html
http://www.impressivewebs.com/css-terms-definitions/
2013-02-15 20:58:23 -05:00
Noah Bass
b4587434f8 Fix link to Pull Request help in CONTRIBUTING.md
GitHub changed their help page URLs and did not correctly redirect the
old Pull Request help URL.
2013-02-10 17:56:56 -08:00
brianblakely
522fa645c3 Added IE10 tap highlight disable & WebKit→IE10 doc 2013-02-09 12:32:51 +02:00
Alexander Zonov
19c03c4bf0 Recommend version-specific python server commands 2013-02-09 12:11:08 +02:00
Hans Christian Reinl
7dae637800 Update jQuery to version 1.9.1 2013-02-05 09:04:19 +01:00
Nicolas Gallagher
922df45999 Use relative paths in README
GitHub recently fixed a problem where relative paths in Markdown files
didn't behave as desired.

Fix gh-1296
2013-01-30 19:28:18 -08:00
Nicolas Gallagher
aa9bcbeb5b v4.1.0 2013-01-20 18:58:04 -08:00
Nicolas Gallagher
c3358e2399 Update to Normalize.css v1.1.0. 2013-01-20 17:55:13 -08:00
Kevin Martensson
3a7de0b41a Update to jQuery 1.9.0 2013-01-15 11:12:23 +01:00
Nicolas Gallagher
964c929ef0 Improve copy in CONTRIBUTING.md
Reflect some of the recent changes in necolas/issue-guidelines that tidy
up the language and simplify parts of the guidelines.
2013-01-13 11:56:44 -08:00
Gregory Pakosz
e9a471bc3f Mention Normalize.css in humans.txt
Normalize.css was missing from the stock humans.txt's technology
colophon.
2013-01-13 10:24:50 -08:00
Nicolas Gallagher
29315016dc v4.0.3 2013-01-12 16:16:35 -08:00
Nicolas Gallagher
90f99e1587 Update CHANGELOG 2013-01-12 16:15:15 -08:00
Jonathan Neal
fb9166461b Merge pull request #1286 from jonathantneal/issue-1285
HiDPI (32x32px) favicon.ico - Issue #1285
2013-01-09 17:15:30 -08:00
Jonathan Neal
21702c4198 HiDPI (32x32px) favicon.ico
32x32-only version. Tested in IE6+, Safari 4+, and the latest Chrome,
Firefox, and Opera.
2013-01-09 17:12:19 -08:00
Simon Owen Design
7bc8241f51 Minor amend, closing a missing bracket. 2013-01-04 19:43:31 +00:00
Devin Rhode
a2b3d06e8b Remove named function expression in plugins.js
Details on various bugs with named function expressions:
http://kangax.github.com/nfe/#jscript-bugs
2012-12-28 12:58:11 +00:00
Nicolas Gallagher
081f8aa0de Adjust CSS image-replacement
Make sure that any text-highlight, or other factors that may break the
illusion, are far enough outside the element to be unnoticed.

Fix gh-1239
2012-12-28 12:39:19 +00:00
Nicolas Gallagher
1987e5a1ee Update HiDPI CSS @media rule
Provide greater cross-browser support. Thanks to Wordpress -
http://core.trac.wordpress.org/changeset/22629 - and @marcedwards - see
issue #1127.
2012-12-28 12:31:58 +00:00
Nicolas Gallagher
46446727b2 v4.0.2 2012-12-09 15:12:30 -08:00
Nicolas Gallagher
3d5d852697 Update placeholder icons
Apply the latest design of the H5BP logo to each of the touch icons and
the favicon.
2012-12-08 10:54:17 -08:00
Hans Christian Reinl
052ecc4b29 Update Normalize.css to 1.0.2
This update corrects `h6` font size normalization.
2012-11-25 20:54:13 +01:00
Frederic Hemberger
dac15682b3 Add note about AddOutputFilterByType in Apache < v2.3.7 2012-11-18 22:30:45 +02:00
Hans Christian Reinl
8c08445487 Merge pull request #1253 from bmcustodio/jquery-1.8.3
Updated 'jQuery' to 1.8.3.
2012-11-14 01:38:33 -08:00
bmcustodio
d141f70910 Updated 'jQuery' to 1.8.3. 2012-11-14 09:06:22 +00:00
Nicolas Gallagher
e9f6a9890c Remove broken link to PDF in cross-domain docs
Adobe have changed the location of the PDF. There is no gaurantee that
it will remain at the new location either. Since we already link to an
Adobe article about the cross-domain policy spec (that links to a PDF)
we don't need to link to both.
2012-11-04 09:44:33 -08:00
alrra
e85301270f htaccess: for consistency, use mod_php5.c 2012-11-01 15:48:09 +02:00
Christian Bundy
0615b940c3 htaccess: sort the values of directives alphabetically 2012-10-30 12:58:54 +02:00
Thomas Bassetto
551dd5c5d6 Fix missing parenthesis to CHANGELOG.md 2012-10-29 15:12:34 +02:00
Nicolas Gallagher
25c1073d13 v4.0.1 2012-10-20 16:01:31 -07:00
Nicolas Gallagher
7b04f32d5a Update CHANGELOG 2012-10-18 21:59:54 -07:00
Hans Christian Reinl
750bf0e093 Further improvements to console stubbing method
These improvements are:

- cache current method in `while`-loop to reduce property look-ups
- use `if` as the conditional assignment in `while`-loop in order to improve performance and readability

Reference: commit 578f377
Closes gh-1229
2012-10-14 21:06:53 +02:00
bmcustodio
dc00673b7c Fix console stubbing method in oldIE
Expose `console` object to global scope in IE6 and IE7

Reference: gh-1229
2012-10-14 15:00:32 +02:00
Nicolas Gallagher
5bed678da0 Update CHANGELOG 2012-09-22 03:15:45 -07:00
Devin Rhode
578f377849 Improve console method stubbing
Avoid browsers with `console` and `console.log` throwing errors for some
of the other methods that they did not support.

Fix gh-1206
Close gh-1218
2012-09-22 03:04:03 -07:00
Nicolas Gallagher
e1b163041e Merge pull request #1219 from ryanve/master
Disambiguate chromeframe prompt wording.
2012-09-22 02:58:52 -07:00
bmcustodio
4ac3ffef5c Updated jQuery to 1.8.2
jQuery 1.8.2 has just been released. Google's CDN has not yet
been updated, but it shouldn't take too long before it is.
2012-09-21 22:41:35 +02:00
Ryan Van Etten
6be0119cd2 Disambiguate chromeframe prompt wording. 2012-09-20 15:14:13 -04:00
Nicolas Gallagher
e6c64a238d Remove duplicate markTimeline from plugins.js
Fix gh-1211
2012-09-19 23:28:55 +01:00
Alec Rust
b378ce239d Enforce coding style in main.css print styles 2012-09-19 23:25:40 +01:00
Nicolas Gallagher
2c079ae144 Add a CONTRIBUTING.md file
Move the information on contributing from the bundled documentation to a
new root file - CONTRIBUTING. This is both a more meaningful location
(not part of code documentation) and allows us to take advantage of
GitHub's latest UI changes that prompt people to read a repo's
guidelines before reporting issues or opening pull requests.
2012-09-17 20:40:46 +01:00
Haralan Dobrev
2dd1153cfc Fix SymLinksIfOwnerMatch typo in .htaccess
Ref. gh-1209
2012-09-17 10:42:15 +02:00
Nicolas Gallagher
bfeac11c9a Update CHANGELOG 2012-09-16 12:07:31 +01:00
Nicolas Gallagher
bb7b3577b1 Remove outdated URL from .htaccess
Fix gh-1201
2012-09-16 12:06:36 +01:00
paulwithap
d20a342c95 Add Apache configuration instructions for Mac 2012-09-16 12:04:08 +01:00
Nicolas Gallagher
0dcd9d120e Rename doc/README to doc/TOC
Avoid the problem with links in a directory README on github.com. GitHub
displays a directory's README when at the dir level, which results in
incorrect URLs when links are using relative paths. This is causing some
confusion for people who browse to the documentation on GitHub and try
to browse the docs from the automatically displayed README.
2012-09-16 11:45:57 +01:00
Nicolas Gallagher
cb0bb16eb7 Revert "fixed all the broken links to doc"
This reverts commit dd420ef187.

The commit itself broken all the links in the documentation README when
the README was viewed directly (as intended). This meant people coming
to the documentation from the html5boilerplate.com site, or those
generating HTML from the markdown docs, were not able to view the docs.
2012-09-16 11:38:04 +01:00
shichuan
dd420ef187 fixed all the broken links to doc 2012-09-16 13:28:42 +08:00
Hans Christian Reinl
1c6485adb9 Update Modernizr to v2.6.2
See http://modernizr.com/news/modernizr-262/ for more information on what changed since v2.6.1.
2012-09-05 22:14:00 +02:00
Hans Christian Reinl
d4467ad7f2 Fix typo in .htaccess documentation, fixes gh-1198 2012-09-03 16:48:46 +02:00
Mathias Bynens
5735ee396d Update to jQuery 1.8.1 2012-08-31 16:16:46 +02:00
Nicolas Gallagher
0b60046431 v4.0.0 2012-08-28 23:41:15 +01:00
Nicolas Gallagher
07ee69683c Fix broken links to issues in CHANGELOG 2012-08-27 19:21:32 +01:00
Nicolas Gallagher
19c8065b6a Small adjustments to documentation 2012-08-27 11:53:46 +01:00
Nicolas Gallagher
6f5ed6f921 Remove placeholder link styles
The placeholder link styles don't add much value but do introduce
potentially unwanted specificity issues. By specifying `a:visited` it
forces subsequent styles for components (like buttons) to have a greater
specificity than this selector if they are to avoid the color changing
once it has been visited.

A similar problem is also evident if a user builds their link styles
upon the project styles (rather than editing the ones included).

This was also an issue in Normalize.css and was fixed in the same way.
2012-08-27 11:38:31 +01:00
Nicolas Gallagher
6415ccd9b0 Remove duplicate line from htaccess
Fix gh-1177
2012-08-27 10:16:05 +01:00
Divya Manian
39a1801a88 Adding a link to Issue Tracker in Reporting Issues section 2012-08-26 08:46:31 -07:00
Divya Manian
dfca687243 Adding link to issues from Changelog
The Regex is 
Find: (#([0-9]+)) 
Replace: [$1](https://github.com/h5bp/html5-boilerplate/$2)
2012-08-26 08:32:34 -07:00
Divya Manian
42f16dfaa1 Formatting headings. 2012-08-26 08:27:39 -07:00
alrra
a36b296b89 More general compression configuration for Apache
Works with Apache ≥ 2.1 and requires `mod_deflate` and `mod_filter` to
be enabled. However, use of Apache < 2.2 is no longer recommended.

For Apache ≥ 2.1 → 2.3.7, `mod_filter` isn't needed, but requiring it
and using this solution is the best way going forward (plus, it doesn't
introduce other dependencies to other modules like, for example,
`mod_version`).

Fix gh-1012
Ref gh-1173
2012-08-23 00:00:24 +01:00
Nicolas Gallagher
68197bc42d Correct typo in the clearfix code 2012-08-22 15:31:48 +01:00
Nicolas Gallagher
adecc5da03 New image replacement approach
This approach uses a pseudo-element to force the element's content
downwards without covering the background of the element. The overflow
is hidden. For IE 6/7, fallback to the cruder `text-indent` method.

Known advantages:

* Works in IE6+ (although better in IE8+).

* Replaces any content in IE8+, including inner HTML.

* Nothing new for people to learn. Works just like all "traditional" IR
  techniques (unlike NIR, which needs you to add the image using a
  pseudo-element's `content` and relies margins for sprite positioning).

* Doesn't draw a large out-of-element box in modern browsers. You can
  even mix in something like `font: 10px/1 a` to reduce ce the size of
  the "off-screen" box, if you really need to.

* Doesn't have any potential SEO problems from `font-size:0`.

* Doesn't care about any minimum font-size that a browser might have.

* Doesn't have any potential failed-IR problems from inherited styles,
  like text being positioned within the element's visible box (i.e., if
  you use other properties like `text-stroke`).

Known issues:

* Doesn't work when images are off or fail to load (same as every other
  IR technique apart from NIR).

* If the IR'ed element has bottom-padding, then either it needs to be
  removed or the height of the pseudo-element needs to be bumped up
  (e.g., set to 200%).

* Doesn't avoid the `inline-block` bug in IE 6/7 due to the text-indent
  fallback for those browsers.

* Doesn't work on input elements (but they shouldn't be the subject of
  IR anyway).

* There is the potential for some final-result differences between
  IE 6/7 and modern browsers, but this is already the case with other IR
  techniques.

Fix gh-1149
2012-08-21 23:37:37 +01:00
Nicolas Gallagher
fac03ef28f Minor update to README 2012-08-21 22:54:40 +01:00
Nicolas Gallagher
38c7a90cbf Minor update to clearfix 2012-08-20 23:38:35 +01:00
Nicolas Gallagher
7b0ba6b083 Update to Normalize.css 1.0.1 2012-08-20 22:57:28 +01:00
Nicolas Gallagher
28f922ff3c Add a HiDPI example media query
`-webkit-device-pixel-ratio` targets WebKit browsers.
`min-resolution` targets everything else.

Reference: http://www.w3.org/blog/CSS/2012/06/14/unprefix-webkit-device-pixel-ratio/

Fix gh-1127
2012-08-18 18:56:42 +01:00
Nicolas Gallagher
445037ccf4 Docs: update FAQ
Remove the section on "profiling" which was incomplete and not directly
linked to the code in this project. Also fix the headings so that
they're all of the same level.

Fix gh-1170
2012-08-18 18:56:29 +01:00
Nicolas Gallagher
920e52a5d4 Add "Hello world" to index.html
This avoids the default template rendering a completely blank page and
makes it easy for people to know straight away that things are
"working".

Fix gh-1165
2012-08-15 22:52:37 +01:00
Nicolas Gallagher
456211dc54 htaccess: include a SymLinksIfOwnerMatch comment
Some web hosts disallows the use of the FollowSymLinks option in
.htaccess files, and suggest the use of SymLinksIfOwnerMatch.

Close gh-1147
2012-08-15 20:48:39 +01:00
Nicolas Gallagher
e52927a03e Docs: adjust line length and whitespace 2012-08-15 00:33:21 +01:00
Nicolas Gallagher
596d9a9dcc Update to normalize.css v1.0.0 2012-08-15 00:21:11 +01:00
brianblakely
50b46d6fa2 Update doc/extend.md
Added:
* IE10/Win8 badges
* Twitter Cards
* Chrome Web Store inline install
* iOS 6 Safari's Smart App Banners
2012-08-14 11:34:55 -03:00
Nicolas Gallagher
1d96e32876 Docs: minor tweaks 2012-08-12 15:17:58 +01:00
Nicolas Gallagher
8e90c33cef Simplify apple touch icons
Remove the radial gradient from around the star symbol.
2012-08-12 15:04:11 +01:00
Nicolas Gallagher
66b137083f Minor HTML indentation change 2012-08-10 12:29:22 +01:00
Nicolas Gallagher
02bdaea124 Docs: add info about using Metro tiles
Thanks to @Kroc for raising this issue and providing extra details. It
has been included in the 'extend' documentation alongside other IE tips.

Close gh-1136
2012-08-10 10:36:23 +01:00
Nicolas Gallagher
5ed4dadf5c Update CHANGELOG
Ref gh-1161
2012-08-10 10:34:12 +01:00
Jonathan Fielding
1c30c5a660 Update jQuery 1.7.2 to jQuery 1.8.0
Ref gh-1161
2012-08-10 09:44:01 +02:00
Nicolas Gallagher
d590b0efe9 Separate normalize.css from main.css
Benefits of disentangling  normalize.css from the rest of the project's
CSS:

* Easier to track normalize.css version.
* Easier to update normalize.css.
* Easier to remove normalize.css if the user wants.
* Clearer distinction between normalizing CSS and the additions that
  HTML5 Boilerplate provides.

Drawback is the additional HTTP request incurred from the extra
stylesheet referenced in the HTML. However, we already do something
similar for the JS, and anyone serious about performance is going to
employ a build process to concatenate and minify CSS/JS.

Ref gh-1132
Ref gh-1140
2012-08-09 21:48:57 +01:00
Nicolas Gallagher
f23340ed9b Add MIT license
Provide a proper, highly permission license, recognized by the OSI, to
remove any potential for ambiguity. Addresses concerns around the
inability to elect to place work in the Public Domain.

Fix gh-1139
2012-08-08 23:56:10 +01:00
Nicolas Gallagher
3ce6e98cde Clean up .gitignore
Remove all the ignores from `.gitignore`. The default boilerplate
doesn't generate any project-specific files that need to be ignored. All
OS and Editor-generated files should be globally ignored rather than
polluting the local project ignores.

Further information on using git ignore's appropriately can be found in
the miscellaneous part of the bundled docs.
2012-08-05 12:22:32 +01:00
Nicolas Gallagher
703d0b8651 Add CHANGELOG
Keep the project history available within the repo; make it easier to
track what is currently changed over the last tagged release.
2012-08-05 11:11:02 +01:00
Nicolas Gallagher
1e3be1842b Rewrite documentation and add to repo
Include all documentation related to the project and its code. This
ensures that docs are available offline and that any future download
will have docs that relevant for the version in use.

This change involves a documentation rewrite to update, simplify,
clarify, and consolidate it.
2012-08-02 14:06:13 +01:00
Nicolas Gallagher
cc265d4511 Remove uncompressed jQuery
Not referenced anywhere else in the project and is unlikely to ever get
used since the CDN version of jQuery is used by default.

Fix gh-1153
2012-07-31 23:39:27 +01:00
Nicolas Gallagher
889e377b2d Remove superfluous code comments
Reduce the perceived complexity and verbosity of certain files by
stripping unneccessary inline comments.

Relevant documentation may end up in a `doc/` directory such that any
download has an accurate and matching code documentation bundle.

Ref gh-1048
2012-07-29 14:48:14 +01:00
Paul Irish
d3969484ff update modernizr to 2.6.1. fixes #1146. ref #1086 2012-07-19 14:17:26 +01:00
Mathias Bynens
5370479476 Create stubbed console methods
Remove the previous `log()` wrapper method as it changed the reported
line position in logs. Instead, avoid `console` errors in browsers
without `console` by setting its methods to empty functions.

Ref. #1107.
2012-07-08 20:20:17 +01:00
alrra
83f4f28186 .htaccess: Serve WebVTT files as text/vtt with UTF-8 encoding 2012-06-24 11:46:06 +02:00
AD7six
288f9922c0 Remove excessive ExpiresByType rule
Ref. #1122.
2012-06-14 09:14:13 +02:00
Hans Christian Reinl
2a60c6b3d1 Add a comment and link to more .gitignore info
A repository's `.gitignore` should be focused on ignoring files within
the repo that we do not want to be committed. For example, a build
directory.

A global ignore is a better place for ignoring OS-level files, editor
extensions, and files that you are always likely to want ignored (e.g.
zip).

Close #1065
Close #1120
2012-06-11 09:21:33 +01:00
Nicolas Gallagher
49089be067 Merge pull request #1119 from alrra/h5bp
Smaller file size favicon.ico
2012-06-10 05:08:38 -07:00
alrra
ca30a53977 replace the 'favicon.ico' with a smaller size one 2012-06-10 14:33:29 +03:00
Nicolas Gallagher
7aa306c0b3 Rename style.css to main.css
Make it consistent with the naming of main.js

Close #1116
2012-06-09 12:32:47 +01:00
Nicolas Gallagher
0c52750ea6 Remove the lang attribute from html
The boilerplate is used with many different languages, not just English.
This makes it inappropriate to have `lang="en"` included by default.

Fix #1110
2012-06-09 11:27:39 +01:00
Hans Christian Reinl
cbde32f684 Typo in .htaccess: Keep-Alive has to be capitalized in the comment too 2012-06-08 13:21:16 +02:00
Hans Christian Reinl
4505fa12b1 Capitalize "Keep-Alive" to match the HTTP-spec
thanks @mathiasbynens
2012-06-05 19:27:22 +02:00
Hans Christian Reinl
5a2585f42c Include Keep-Alive header in .htaccess
as discussed in #1115
2012-06-05 19:07:33 +02:00
Nicolas Gallagher
d2d5fd1eac Merge pull request #1113 from nchaves/master
Fixing two bugs introduced into plugins.js during reformatting to multiline
2012-06-04 02:58:38 -07:00
Nick Chaves
d242bd27cd Fixing two bugs introduced in the multiline reformat
First bug is that the "c" is expected by the for loop condition to be
the array, not the string.  Second bug is that the new semicolon on
line 36 (after the first anonymous function declaration) separated the
calling parentheses and the return result of the second function, which
was intentionally attached as a parameter to be passed in as "a" to the
first.
2012-06-04 00:38:12 -06:00
Nicolas Gallagher
7a2f9dcf8b Formatting and consistency improvements
- Consistent use of quotes in HTML.
- Consistent use of hex for color values in CSS.
- Multi-line CSS and JS.
- 4 spaces for indentation.
- Always use closing tags.
- Use common DOCTYPE capitalization.

These are steps toward reducing the number of repeat issues we get
around inconsistencies or uncommon patterns; making diffs more readable;
and using common conventions.
2012-06-02 11:29:38 +01:00
Nicolas Gallagher
6bfd7948c6 Humans.txt prettification
Simplify the template a bit. Switch to hash-style comments to mirror
robots.txt standard.
2012-06-01 21:47:17 +01:00
Nicolas Gallagher
3942ee1775 Merge pull request #1095 from clarkni5/master
Add [OR] to rewrite condition

The first condition checks to see if the request matches a directory and the second condition checks to see if it matches a file. Without the [OR], the condition always fails.
2012-05-28 07:44:41 -07:00
Mathias Bynens
e53c1df9cf Merge pull request #1097 from karlpcrowley/patch-1
.htaccess: Prevent mobile network providers from modifying your site (disabled by default)
2012-05-20 23:03:02 -07:00
Karl Crowley
d055e4e6c1 Updated .htaccess:
Prevent mobile network providers from modifying your site
2012-05-20 12:55:49 +02:00
Nicholas Clark
4934c5defd Update documentation. 2012-05-18 16:33:33 -04:00
Nicholas Clark
b2b24c351e Add missing or next condition. 2012-05-18 16:24:27 -04:00
Hans
c20eb1a6fa Merge pull request #1071 from mikealmond/master
Add some MIME-types (JSON, JSONP, audio, video and flash), a note about a custom 404-file and a PHP flag (magic_quotes_gpc)
2012-04-25 09:54:05 -07:00
Mike Almond
09dc03ae17 Merge branch 'master' of git://github.com/h5bp/html5-boilerplate
* 'master' of git://github.com/h5bp/html5-boilerplate:
  Update .gitignore to include AppleDouble (dot underscore) files
  Update .gitignore to include Rubinius's compiled files.
2012-04-25 09:03:26 -04:00
Mike Almond
6e1417b857 Adding JSONP 2012-04-25 09:02:49 -04:00
Hans
509648b8a5 Merge pull request #1073 from lekkerduidelijk/patch-3
Update .gitignore to include AppleDouble (dot underscore) files
2012-04-25 02:27:36 -07:00
Rutger Laurman
e1e53cf83c Update .gitignore to include AppleDouble (dot underscore) files 2012-04-25 09:51:21 +03:00
Hans
1ab8d64169 Merge pull request #1055 from danielgrippi/patch-1
Include Rubinius' compiled files in .gitignore
2012-04-24 15:18:54 -07:00
Mike Almond
e49353b05f Adding new MIME types, a note about 404, and a PHP flag
Fixes #1062 and #1053
2012-04-24 16:19:51 -04:00
Hans Christian Reinl
a95f300ac8 Change selection-color in 404 error template, closes #1067
The selection-color was changed in 1d320b5. Add this background-color in the 404 error template and remove the text-color. Thanks to @elexx.
2012-04-23 23:33:31 +02:00
Nicolas Gallagher
1d320b59a3 R.I.P. Hot pink text-selection highlight
Replace hot pink with a more neutral selection background color: the
default found on OS X.

A number of high-profile sites have failed to customize the hot pink
default that HTML5 Boilerplate used to include. People should be able to
trust the project to include sensible defaults. Keeping hot pink in
there by default breaks the "no surprises" expectation of amateur and
professional developers.

Ref #610
Ref #969
2012-04-22 15:08:46 +01:00
Nicolas Gallagher
eb2dc2fe90 Remove HTML comment about appcache
Using appcache is complicated and can have unexpected consequences if
you do not have a good grasp of the spec. The way that this project
suggested using appcache was likely to be problematic.

Ref #1060
2012-04-20 23:39:14 +01:00
Daniel Grippi
1b581aff02 Update .gitignore to include Rubinius's compiled files. 2012-04-18 18:44:18 -07:00
Nicolas Gallagher
c264d91c6c Merge pull request #1051 from sjonnet/patch-1
Additional changes to index.html for rename libs to vendor
2012-04-14 07:10:37 -07:00
Shawn Jonnet
02bf76cd16 Additional changes to index.html for rename libs to vendor 2012-04-14 10:06:54 -03:00
Nicolas Gallagher
3606c8345f JS: rename libs/ and script.js
The dir name `vendor/` is increasingly common and this small change
might save some people a bit of time when it comes to using the project
with RequireJS et al.

See:

http://www.javascriptu.org/decks/sd/building_the_foundation/#slide-51
2012-04-13 20:16:20 +01:00
Nicolas Gallagher
cfae00adab Merge pull request #963 from ProBackup-nl/master
Remove * {filter:none} from media print due to IE9 repositioning and float issues
2012-04-10 16:42:58 -07:00
Nicolas Gallagher
5469e272a4 Remove placeholder content from <body>
Lengthy previous discussion in #203

Close #926
Close #1033
2012-04-11 00:35:29 +01:00
Nicolas Gallagher
21e77285e2 Merge pull request #998 from Calvein/patch-1
Added a link to explain why to put the JavaScript file at the bottom
2012-04-10 16:28:42 -07:00
Paul Irish
b0db5d5eb6 Merge pull request #1043 from Kvakes/master
Espresso generated files
2012-04-08 07:46:51 -07:00
Max Izmailov
060ac246fd Ignore files generated by Espresso 2012-04-08 15:18:19 +02:00
Nicolas Gallagher
339b6c96ad Remove .htaccess comment about query params
Using query params to version files is not recommended. This removes
a stray reference to that technique.

Close #997
2012-04-07 00:52:52 +01:00
Paul Irish
086280e6fd linking up some docs for the RewriteBase cloud issues. ref #1015 2012-04-06 15:57:29 -07:00
Hans
ce64453057 Merge pull request #1015 from WraithKenny/patch-1
Add RewriteBase to .htaccess - commented out by default as it allows for use w/o configuration.
2012-04-06 15:52:38 -07:00
Hans
00ee25c1be Merge pull request #1036 from alecrust/patch-1
Corrected spacing
2012-04-04 13:39:39 -07:00
Ken Newman
6c1c1db5a2 Comment-out RewriteBase by default. This allows for "no-configuration" flexible deployment. Some servers need this setting configured, but the value depends on deployment location. 2012-04-03 12:55:40 -03:00
Alec Rust
263af0b468 Corrected spacing 2012-04-03 11:57:00 +02:00
Hans
4026f03249 Merge pull request #1026 from jonathan-fielding/master
Updated the jQuery to 1.7.2
2012-03-29 13:54:23 -07:00
Divya Manian
258cbef93c Merge pull request #1029 from philipwalton/strict-log
added a try/catch block to make log work with 'use strict'
2012-03-28 15:51:56 -07:00
Philip Walton
9cb7e46f32 added a try/catch block to make log work with 'use strict' 2012-03-22 23:29:10 -07:00
Divya Manian
863de294e8 Actually fixing #1028. Thnx @niftylettuce 2012-03-22 21:20:25 -07:00
Divya Manian
7912513084 Fixing typo in css class. Fixes #1028 2012-03-22 21:07:39 -07:00
Jonathan Fielding
1c55518def Updated jQuery to 1.7.2
Signed-off-by: Jonathan Fielding <j.fielding@me.com>
2012-03-21 23:42:54 +00:00
Mathias Bynens
9cf989542c Further optimize the new touch icons
apple-touch-icon-114x114-precomposed.png |  Bin 3247 -> 3242 bytes
   apple-touch-icon-144x144-precomposed.png |  Bin 3779 -> 3777 bytes

Ref. #1025.
2012-03-21 08:35:50 +01:00
Mathias Bynens
9ced71e8ef Merge pull request #1025 from richardcornish/master
Redesigned touch icons and favicon
2012-03-21 00:31:17 -07:00
Richard Cornish
e2fff6fe07 Redesigned touch icons and favicon
New icons designed to be sharper on the pixel grid, with slight light
source variations that are pleasing to the eye in a touch environment.
Also put through ImageAlpha and ImageOptim for added optimization.
Please see
http://dl.dropbox.com/u/2066483/h5bp-icons/docs/comparison.png for
before/after comparison.
2012-03-21 00:41:50 -05:00
Mathias Bynens
923b0f3adc Add 144×144px touch icon for third-generation iPad
See http://mathiasbynens.be/notes/touch-icons. Closes #1020.
2012-03-16 16:44:15 +01:00
Ken Newman
767dc09916 Add RewriteBase subdirectory note. 2012-03-13 15:11:02 -03:00
Ken Newman
efe88dfbf2 Update .htaccess 2012-03-13 14:33:13 -03:00
Ken Newman
1ec581885a Cloud Sites (and probably other cloud/shared hosting) needs a RewriteBase set for rewrites to work. See http://www.rackspace.com/knowledge_center/index.php/Why_is_mod_rewrite_not_working_on_my_site 2012-03-08 14:38:57 -05:00
Nicolas Gallagher
aa0396eae7 Update CSS image replacement technique
The new technique avoids various problems with any text-indent method.
The benefits are:

* No box of any kind is drawn offscreen, so there is no risk of
  related performance problems in old iOS devices.

* No need to specify a text-alignment and hide overflow since the text
  is crushed to take up no space.

* No need to hide `br` or make all fallback HTML `display:inline`
  because unlike the text-indent approaches, this method is not
  affected by those scenarios.

* Fewer styles are needed as a result of these improvements.

The function of the new CSS is as follows:

* `font: 0/0 a` is a shorthand property that reduces the font-size and
  line-height to 0. The `a` value acts as a font-family. The CSS
  validator complains that using `0/0` in the shorthand `font` property
  is not valid, but every browser accepts it.

* `text-shadow: none` makes sure than any inherited text shadow is
  removed, otherwise it will show over the image.

* `color: transparent` is only really needed in browsers than don't
  completely crush the text to the point of being invisible. Safari 4 is
  such a browser (but extremely rare). Leaving it in for now in case
  there are any mobile browsers that require it. Upon further testing,
  it may be possible to remove this declaration.

Some parts of the pre-existing image replacement technique have been
retained. The border and background resets are useful when using IR on
form submit inputs or buttons, as well as when links use default borders
or backgrounds

Close #1005
2012-03-06 00:12:12 +00:00
Nicolas Gallagher
758eab9f35 Merge pull request #1010 from richardcornish/master
Added `application/xml` for RSS MIME types
2012-03-05 01:46:27 -08:00
Richard Cornish
c448cc03e7 Added application/xml for RSS MIME types
Based on research on the [issue
list](https://github.com/h5bp/html5-boilerplate/issues/989)
2012-03-05 03:43:08 -06:00
Mathias Bynens
db1574059d Merge pull request #1003 from alrra/h5bp
Updated link in the "robots.txt" file
2012-02-28 13:35:52 -08:00
alrra
ca4bf4793d updated the "Controlling Crawling and Indexing" link from the "robots.txt" file 2012-02-28 23:14:17 +02:00
François Robichet
1aad336ef7 Added a link to explain why put the JavaScript file at the bottom 2012-02-26 20:48:02 +01:00
Paul Irish
1929462a39 Merge pull request #994 from Jakobud/master
Changed Cache-Busting help url in the .htaccess
2012-02-21 18:56:06 -08:00
Jake Wilson
5bbd604930 Changed cache-busting help url 2012-02-21 19:32:16 -07:00
Paul Irish
b0ddd13910 Merge pull request #992 from mikealmond/master
Removing the <Location> tag from the P3P Header - Fixes issue #975
2012-02-21 11:18:15 -08:00
Mike Almond
fe6c2f56ec Removing the <Location> tags from the P3P Header
The Location tag was causing a 500 error.
2012-02-21 13:59:16 -05:00
Paul Irish
f8f347e392 new modernizr. 2012-02-19 11:00:08 -08:00
Paul Irish
080026e4f4 modernizr 2.5.2. includes html5shiv 3.3. 2012-02-07 18:28:52 -08:00
Paul Irish
9434b5bc79 upgrade Modernizr to 1.5.1 which includes IE7 fix. also yepnope 1.5.2 2012-02-07 17:35:49 -08:00
Mathias Bynens
f9ebf5d2e9 Merge branch 'master' of github.com:h5bp/html5-boilerplate
* 'master' of github.com:h5bp/html5-boilerplate:
  2.5 version string in modernizr.
  update index for upgraded modernizr.
  update modernizr and yepnope to brand new latest.
2012-02-06 14:28:16 +01:00
Mathias Bynens
c93f45ff38 Normalize short URLs pointing to GitHub issues
Ref. #954.
2012-02-06 14:25:02 +01:00
Paul Irish
5dbb3b4b0a 2.5 version string in modernizr. 2012-02-05 22:20:28 -08:00
Paul Irish
deeb952314 update index for upgraded modernizr. 2012-02-05 22:03:22 -08:00
Paul Irish
0659528100 update modernizr and yepnope to brand new latest. 2012-02-05 22:03:01 -08:00
Mathias Bynens
4d65006439 .htaccess: Block access to Vim backup files correctly
Fixes #937.
2012-02-05 13:46:28 +01:00
Nicolas Gallagher
ab117fc461 Merge pull request #966 from dhaigh/master
Whitespace removal
2012-02-04 03:43:09 -08:00
Declan Haigh
5d2a6dbe3a obsessive compulsive whitespace removal 2012-02-04 21:31:25 +10:00
ProBackup-nl
a2240384c7 Remove @media print "filter:none !important; -ms-filter: none !important;".
In combination with html form input tags, having float:left style applied, Modernizr 2.0.6, IE9 and PIE-1.0beta6 (for rendering CSS3 properties in IE) the setting of "filter:none" causes the input elements to disappear. See it for yourself (in IE9):

http://www.kbrbeheer.nl/bugs/h5bp/stylesheet-media-print/with-filter.html
http://www.kbrbeheer.nl/bugs/h5bp/stylesheet-media-print/without-filter.html
Or when you haven't got IE9 at your disposal:
http://www.kbrbeheer.nl/bugs/h5bp/stylesheet-media-print/with-filter.pdf
http://www.kbrbeheer.nl/bugs/h5bp/stylesheet-media-print/without-filter.pdf
2012-02-03 17:23:35 +01:00
Nicolas Gallagher
cedd640083 Avoid using @defer on interdependent <script>s
Whenever a deferred script makes HTML be parsed into the DOM tree
(e.g. when innerHTML, insertAdjacentHTML(), appendChild(),
insertBefore(), replaceChild() etc. are used), IE < 10 may start
looking for more deferred scripts to run, immediately executing
them before the first deferred script has completed.

More information: https://github.com/paulirish/lazyweb-requests/issues/42

Close #961
2012-02-03 15:15:19 +00:00
Nicolas Gallagher
ac50fbc1e2 Update readme 2012-02-03 13:43:07 +00:00
Nicolas Gallagher
f96fed6942 Remove ant build script. Close #826
The ant build script is now in a separate, dedicated repo at:
http://github.com/h5bp/ant-build-script
2012-02-03 12:38:26 +00:00
Nicolas Gallagher
f2924da1b1 Merge pull request #960 from alrra/h5bp
added a more informative page link in the 'robots.txt' file
2012-02-03 03:45:37 -08:00
alrra
a111a79500 added a more informative page link in the 'robots.txt' file 2012-02-03 12:50:06 +02:00
Paul Irish
ce0c28932b update plugins.js to be jshint compliant. fixes #952 2012-01-31 17:31:07 -08:00
Paul Irish
d7e668235f Chromeframe prompt doesnt reccomend IE6 -> IE8. We need mitigate IE8's role as a boat anchor browser as much as possible 2012-01-31 12:26:54 -08:00
Nicolas Gallagher
8552d9543e Re-set default cursor for disabled input and button. Fix #887 2012-01-31 16:12:19 +00:00
Divya Manian
af3bd79de5 fixing the regexes, hopefully for the last time. Unsure where last night's commit went. Thanks @kblomqvist 2012-01-31 07:14:54 -08:00
Divya Manian
2dcdaf0104 fixing conflicts 2012-01-30 19:17:43 -08:00
Divya Manian
3cebea1671 fixing build script AGAIN. Wondering why it worked the first time around? :/ 2012-01-29 20:35:16 -08:00
Divya Manian
a5e31d6132 Updating build tools to their latest versions 2012-01-29 20:26:32 -08:00
Divya Manian
37470f8da6 Merge pull request #949 from adeelejaz/issue/201
Fixes #201 (finally!)
2012-01-29 19:55:50 -08:00
Adeel Ejaz
e1b81302bd Fixes #201 (finally!) 2012-01-30 03:23:23 +00:00
Divya Manian
965f3f1636 Fixing the appending of manifest when php tags exist. Fixes #912 2012-01-29 16:58:14 -08:00
Nicolas Gallagher
fddbaa3487 Move base font-family and color declaration to html.
Applying these shared styles to `html` ensures that people can set
their own overrides on `html` later in the CSS. If the starting
styles were on `body`, then setting them on `html` later in the
CSS would not have the intended effect.
2012-01-29 23:15:33 +00:00
Nicolas Gallagher
26d6be2479 Remove initial-scale from meta viewport. Fix #824 2012-01-29 23:09:12 +00:00
Divya Manian
611162c891 fixing damned whitespaces 2012-01-29 14:22:24 -08:00
Divya Manian
f5d13045c0 cleaning up style.css for chrome frame 2012-01-29 13:14:43 -08:00
Divya Manian
cff92881a8 updated the regex pattern to only look for href=<folder path>/style.css, so it doesnt matter where href is present in the link. Fixes #927 2012-01-29 13:06:10 -08:00
Divya Manian
2eb19a9c99 need opts.extra to be always present to stop build script from throwing an error that it is not found 2012-01-29 13:05:05 -08:00
Divya Manian
2b5f881ecc Made all the arguments for htmlcompressor part of config file. Also added optional additional arguments list in project.properties. Fixes #672 2012-01-29 11:21:39 -08:00
Divya Manian
6a304122b7 Reports of crashes using the chrome frame script check. Instead using the prompt message with a link to chrome frame or a newer IE. Fixes #695 2012-01-29 08:44:45 -08:00
Divya Manian
8b1f5ebe50 copying over the libraries, fixes #944 2012-01-29 08:19:50 -08:00
Nicolas Gallagher
4b213f9050 Merge branch 'master' of github.com:h5bp/html5-boilerplate 2012-01-26 15:33:29 +00:00
Nicolas Gallagher
0bf9143cd1 Additional tweaks to 404.
Simplify CSS styling the Google Search inputs. Improve the
appearance of the keyword input. Use `body` as wrapper. Add `lang`
attribute to `html`.

Thanks to @sindresorhus for suggestions and improvements in #941
2012-01-26 15:29:10 +00:00
Divya Manian
d269a55d45 OK, so this commit ensures that after removing mylibs. the build script works.
What it also ensures is that the file.js.bypass also still works. This means the script looks for these files within the parent js directory. Also finally these files will actually remain untouched compared to previous versions where they were minified/concatenated but just not included.

This means any js file in any folder not included by default in h5bp will be concatenated and minified and output as a single script-hsa.js file. If you do not want this, make sure to do <folder>/* in file.js.bypass in config/project.properties
2012-01-25 23:24:44 -08:00
Nicolas Gallagher
c04b0b57b5 Remove reference to Respond from HTML comment in head 2012-01-24 19:33:13 +00:00
Nicolas Gallagher
f6ccd1032d Simplify JS folder structure. Close #807 2012-01-24 19:31:12 +00:00
Nicolas Gallagher
af98e6fc51 Update Modernizr to remove Respond. Change placeholder Media Query.
Previous version of Respond was known to cause problems in IE8.
It was not necessary for developers who chose to write their CSS
in a 'mobile first' manner. Furthermore, there are some concerns
about the performance penalty Respond imposes upon legacy versions
of IE. If a future version of Respond is shown to be performant
and more reliable, it may be reconsidered for inclusion.

Along with this change is a simplification of the placeholder
Media Queries. Now there is only 1 Media Query example and it is
more clearly labelled as an example. The use of `em` units in the
condition is to reinforce the idea that Media Query breakpoints
should not be device-specific.

Fix #816
2012-01-24 19:19:52 +00:00
Nicolas Gallagher
f0358b52a5 Merge pull request #923 from muiku/gh-920
Fix gh-920
2012-01-24 03:27:27 -08:00
Nicolas Gallagher
1dd911f06a Update design of 404. Close #931
Implement and build upon the design provided by @sindresorhus.
Thanks!
2012-01-24 01:29:06 +00:00
Nicolas Gallagher
1738287ce9 Remove WebKit search cancel button from OS X
This WebKit pseudo-element is only displayed on OS X and is poorly
positioned once you begin to customise the style of a `search`
type input.
2012-01-22 22:01:18 +00:00
Nicolas Gallagher
5c02f406e4 Remove forced scrollbars on html element. Fix #918
This can cause problems for JavaScript plugins (such as modal or
drag-and-drop UIs) in Firefox.
2012-01-22 18:11:34 +00:00
Nicolas Gallagher
2dc1493df6 Allow legend text to wrap in older versions of Firefox. Fix #883 2012-01-22 18:09:44 +00:00
Nicolas Gallagher
79beb6c91c Merge pull request #762 from smashercosmo/master
Removing extra space around checkboxes and radio buttons in IE7
2012-01-22 10:06:28 -08:00
Paul Irish
26ea01971c buildscript properties file. inline example for excluding folders 2012-01-20 11:07:26 -08:00
Kim Blomqvist
4932b4070f It should have been a negative lookbehind
- In addition greater than character (>) in the regexp had to been escaped
2012-01-20 18:42:53 +02:00
Kim Blomqvist
27d1fda0dc Fix gh-920 2012-01-19 21:22:34 +02:00
Kim Blomqvist
e80a3e0637 Fix gh-912
- Add regexp lookahead to skip ?> (php-tag)
2012-01-19 20:41:01 +02:00
Paul Irish
a36d558702 Merge pull request #906 from gzoller/master
Support for js modules with cachebusting
2012-01-18 18:06:05 -08:00
Greg Zoller
3e0b0de9da Removed index.html example mods for module support. Comments in wiki. 2012-01-17 21:01:57 -06:00
Paul Irish
ce9c57c105 CFInstall: cannot have [defer] on a external/inline script combo. fixes #913 2012-01-17 08:47:11 -08:00
Mathias Bynens
f4cd5c18a3 Merge pull request #910 from mikealmond/master
Adding php dist files to the blocked extensions list
2012-01-12 22:06:13 -08:00
Mike Almond
0f9507774b Adding .dist files to the list of filetypes blocked to a user 2012-01-12 20:46:56 -05:00
Mathias Bynens
01296493e7 Revert e2ca1bf931
Ref. #891.
2012-01-07 21:18:58 +01:00
Nicolas Gallagher
8c4ce42af3 Remove author meta tag from head 2012-01-06 15:40:09 +00:00
Greg Zoller
3719f56c86 Added support for js modules 2012-01-05 17:46:14 -06:00
Divya Manian
b3755703b7 Merge pull request #873 from lukeb/patch-1
Requests shouldn't fail if the file or directory beginning with a period...
2011-12-31 07:18:15 -08:00
Divya Manian
f6830c199b Merge pull request #884 from tralston/master
Added target "copyall" in build.xml for the "dev" environment
2011-12-30 17:01:41 -08:00
Divya Manian
f93c8e1636 adding basedir for all tasks. Fixes #437 2011-12-30 07:48:38 -08:00
Divya Manian
5884c3a5fd Updating intermediate folder to not minify the bypassed files. Fixes. #694 2011-12-30 07:31:35 -08:00
Divya Manian
d5c0d33d10 removing imgcopy from buildscript as it is a remnant and not useful. Fixes #845 2011-12-30 07:18:15 -08:00
Divya Manian
b780098073 Merge pull request #881 from splendeo/fix-htaccess
make .htaccess (a bit) less restrictive
2011-12-30 06:53:34 -08:00
Divya Manian
2e1a7bf567 Merge pull request #872 from mikemorris/patch-1
Removed ' <!--<![endif' from regex search string for adding manifest attribute
2011-12-30 06:42:00 -08:00
Mathias Bynens
481dfc1966 Merge pull request #891 from laukstein/patch-2
Apache performance tweak with -SymLinksIfOwnerMatch and +FollowSymLinks
2011-12-28 02:45:25 -08:00
Binyamin Laukstein
71d5229611 Added Apache docs URL 2011-12-28 11:20:24 +02:00
Addy Osmani
32aabb23f7 Merge pull request #830 from mattyclarkson/master
404.html updates.
2011-12-27 16:46:03 -08:00
Mathias Bynens
fd52982efd Escape the . character correctly in FilesMatch directives
Fixes #898.
2011-12-24 08:56:42 +01:00
Mathias Bynens
9feb29f465 Omit .html and .txt from the AddCharset statement
As AddDefaultCharset already takes care of text/plain and text/html. This reverts 024600fd57.
2011-12-22 07:51:26 +01:00
Mathias Bynens
23bd766955 Only send CORS headers for images by default
Ref. #797.
2011-12-20 08:20:04 +01:00
Paul Irish
024600fd57 force utf-8 for .txt for funsies. 2011-12-17 12:06:58 -08:00
Binyamin Laukstein
e2ca1bf931 Apache Performance Tuning http://httpd.apache.org/docs/current/misc/perf-tuning.html#symlinks
Set -SymLinksIfOwnerMatch to avoid Apache extra system calls to check up on symlinks.
2011-12-14 21:58:54 +02:00
Paul Irish
2b5eeeef27 adding mimetype for .webapp, Mozilla's new app manifest type. more:
This content-type is neccessary apparently:
  https://developer.mozilla.org/en/Apps/The_Manifest
2011-12-13 11:51:33 -08:00
Nicolas Gallagher
e97689d7aa Merge pull request #885 from elexx/master
createproject.sh - removed test
2011-12-10 04:21:28 -08:00
elexx
791734033f Removed test from copy, because the directory has been removed long ago (0a80ebafd0). 2011-12-10 13:13:39 +01:00
Taylor Ralston
cafea9f090 Added target "copyall" in build.xml for the "dev" environment
Fixes issue with not copying non-optimized .css and .js files into the publish folder. If dev environment is selected, .css and .js aren't minified, thus they aren't copied over with existing "copy" target.
2011-12-09 13:04:21 -07:00
Enrique García Cota
d582fe5d8e made .htaccess less restrictive
The rule that made .htaccess restrict access to files (.log, .bak,
.sh, ...) was missing an escape sequence on its dot.

As a result, in addition filtering problematic files, it also filtered
some very valid urls. For example:

    mysite.com/blog        <- satisfies /.log$/ and gets filtered
    mysite.com/hit-refresh <- satisfies /.sh$/ and gets filtered

This change modifies .htacces so the dot is interpreted as a literal dot
character, avoiding those issues.
2011-12-07 19:02:42 +01:00
Luke Brookhart
a835a4dbb0 Requests shouldn't fail if the file or directory beginning with a period doesn't exist. Some CMS's will allow for appending ".qr" to a URL to get a QR code. 2011-11-30 11:54:35 -05:00
mikemorris
ba7d47f931 Removed ' <!--<![endif' from regex search string for adding manifest attribute. Works fine without this segment, and no longer prevents the build script from adding the manifest attribute if the IE conditional comments are removed. 2011-11-29 13:17:50 -05:00
Paul Irish
b1e3aa5fe4 Merge pull request #871 from drublic/master
Update jQuery to 1.7.1
2011-11-28 16:04:50 -08:00
drublic
a8e96a79a1 Update jQuery from version 1.7.0 to 1.7.1
Signed-off-by: drublic <hans@sa-designz.de>
2011-11-29 00:17:26 +01:00
drublic
d8e28f2f2e Merge branch 'master' of https://github.com/h5bp/html5-boilerplate 2011-11-29 00:10:18 +01:00
Mathias Bynens
2727fa23a6 Send CORS headers if browsers request them. This enables CORS-enabled images (@crossorigin). Closes #797. 2011-11-28 20:00:09 +01:00
Nicolas Gallagher
fdb58e6815 Merge pull request #866 from AD7six/feature/slim-gitignore
git ignore files do not need to ignore ignoring themselves
2011-11-23 04:45:00 -08:00
AD7six
875df4e9b5 git ignore files do not need to ignore ignoring themselves
To ensure the dir exists with git, a file is required - but it can be
completely empty.

Since the git ignore file is already in the repo it is not necessary to
not-ignore it - it is already tracked.

Though trivial these !.gitignore files are being understood by some to
mean that they must contain this exact syntax to ensure an empty folder
exists.
2011-11-23 13:20:56 +01:00
Nicolas Gallagher
a0cf284836 Merge pull request #862 from martinsik/master
removed _trackPageLoadTime - it's now enabled by default in Google Analytics
2011-11-20 12:05:52 -08:00
martinsik
a7b1a71624 removed _trackPageLoadTime because it's not necessary any more 2011-11-20 20:42:41 +01:00
Paul Irish
f40da1b529 minor. filename typo. 2011-11-17 12:37:37 -08:00
drublic
9efe695f4d jQuery minified was still 1.6.4. fixes #852
I don't know why pretty sure I updated it.
Anyway… here comes the latest version.

Signed-off-by: drublic <hans@sa-designz.de>
2011-11-17 09:32:53 -08:00
Paul Irish
05965584fc hey filename, take it easy. use your inside voice. 2011-11-17 09:32:22 -08:00
drublic
2dd8ad97f8 jQuery minified was still 1.6.4. fixes #852
I don't know why pretty sure I updated it.
Anyway… here comes the latest version.

Signed-off-by: drublic <hans@sa-designz.de>
2011-11-17 10:42:23 +01:00
Mathias Bynens
78533f248c Update Modernizr header with a more specific build link. 2011-11-11 09:09:34 +01:00
Paul Irish
8bf92b0989 Merge pull request #852 from drublic/master
Update jQuery to the latest version
2011-11-10 15:20:44 -08:00
drublic
8074f1584f Update jQuery form 1.6.4 to 1.7.0
Signed-off-by: drublic <hans@sa-designz.de>
2011-11-11 00:10:21 +01:00
Matt Clarkson
6122ef5ab1 Added the 'px' back in for the things that need it. Added consistent spacing to the styling. 2011-11-09 01:35:07 +00:00
Matt Clarkson
212afb9d43 Added padding to the inputs so that they look better. 'look' is always a personal opinion though... 2011-11-08 01:34:51 +00:00
Matt Clarkson
8278b4552d Updated styling to be more consistent and terse 2011-11-08 00:45:56 +00:00
Divya Manian
ce11ab3f8e Merge pull request #846 from mikealmond/master
Block access to backup/source/config files. Fixes issue #648
2011-11-07 07:44:14 -08:00
Mike Almond
8b634157e3 Block access to backup/source/config files. Fixes issue #648 2011-11-07 09:38:37 -05:00
Divya Manian
588e82c8dc Adding Opera extension to mimetypes and unsetting X-UA-Compatible for opera extensions. Fixes #827 2011-11-06 14:08:45 -08:00
Divya Manian
07634ccaf1 Merge pull request #838 from dplesca/master
Fix for issue #837
2011-11-06 01:33:54 -07:00
Paul Irish
1c18e9e8ca Merge pull request #842 from akavlie/master
Link fixes
2011-11-04 19:43:03 -07:00
Aaron Kavlie
821f3449aa Fix a couple of links in build files that still point to github.com/paulirish 2011-11-04 19:27:14 -07:00
Nicolas Gallagher
4a69c41694 Update urls in .htaccess to reference the new repo and wiki locations 2011-11-04 21:26:42 +00:00
dplesca
6290f4018c Fix for Issue #837. 2011-11-03 12:30:23 +02:00
Mathias Bynens
5718718cdd Use h5bp.com short URL for the viewport discussion. Closes #836. 2011-11-02 08:53:20 +01:00
Mathias Bynens
d526c488ea Merge pull request #836 from kridolfo/patch-1
Update short link for X-UA-Compatible issue in GitHub to point to new repo.
2011-11-02 00:51:53 -07:00
Kyle Ridolfo
e0b5b1c93d Update short link for X-UA-Compatible issue in GitHub to point to new repository. 2011-11-01 12:32:48 -03:00
Matt Clarkson
0eb2dc932a Removed dynamic URL 2011-10-31 09:07:41 +00:00
Paul Irish
fb6d9387ed Merge pull request #832 from adrienkohlbecker/master
Fixed PNG optimization on unix & macos
2011-10-30 11:24:56 -07:00
Adrien Kohlbecker
b0fd587b26 PNGs weren't optimized on unix & macos 2011-10-30 13:12:17 +01:00
Matt Clarkson
5347f874ed Added the URL to the mistyped address and some nicer styling to the text box and button 2011-10-28 17:15:20 +01:00
Nicolas Gallagher
d32dfb7a48 Update README repo urls 2011-10-26 22:00:32 +01:00
Nicolas Gallagher
380c4f80d8 Add default font-size and line-height styles.
Redeclare default font-size using ems (equates to 16px if user
has not altered their prefs). Set a common line-height value to
improve readability in most cases. Should keep people happy.

Ref #723
Close #825
2011-10-25 20:35:19 +01:00
Nicolas Gallagher
125a7a6840 Remove default font-size and line-height. Close #724
The previous font-size and line-height were fairly arbitrary
values taken from the much earlier use of YUI font defaults.
Remove them in favour of developers specifying their own values
based on the typographic requirements of their design.
2011-10-23 20:29:19 +01:00
Nicolas Gallagher
1437e0fefd Remove demo folder.
The demo files haven't been well maintained and are of limited
use. Remove them to simplify the boilerplate.

Ref #808
2011-10-23 20:19:47 +01:00
Nicolas Gallagher
0a80ebafd0 Remove test folder.
Over 80% of people polled are not using the qunit testing
provided. Remove it in favour of people using their unit testing
framework of choice.

Ref #808
2011-10-23 20:05:31 +01:00
Divya Manian
5fdb99f91b adding a depends -clean. fixes #692 2011-10-19 22:40:21 +05:30
Divya Manian
b72f114d95 Merge pull request #813 from dflydev/master
Handle absolute path for name and optionally accept name on command line
2011-10-19 09:52:41 -07:00
Divya Manian
90734c0b45 Adding all images in the img folder to the manifest. Fixes #760 2011-10-19 21:57:58 +05:30
Beau Simensen
f022785b64 Added internal documentation per #813 2011-10-19 10:25:24 -05:00
Paul Irish
d20c503e08 Merge pull request #818 from localpcguy/patch-1
Use REM for comments to avoid error messages on the DOS prompt for Window
2011-10-18 15:46:47 -07:00
localpcguy
a37f57addb Use REM for comments to avoid error messages on the DOS prompt for Windows users 2011-10-18 19:37:30 -03:00
Mathias Bynens
a87078d406 Cleaner, more obvious indentation in .htaccess. Closes #817. 2011-10-18 22:39:58 +03:00
Nicolas Gallagher
ecdb8d79ac Add line-height:0 to .ir helper class. Close #811
The .ir helper class's use of a negative text-indent is not enough
to hide the text of submit inputs in IE6/7. This deals with that
scenario.
2011-10-15 14:50:08 +01:00
Nicolas Gallagher
f3cc3a28e4 Rewrite the README.
Previous version was acting more like a changelog. This update
provides a better overview of the project, more useful information,
clearer description of how to get involved, and links to the
various project resources.
2011-10-15 12:03:26 +01:00
Beau Simensen
8d50ceb127 Handle absolute directories for "name" and optionally take name as command line argument. 2011-10-14 15:10:58 -05:00
Paul Irish
f1e9bb3f94 QUnit updated to 1.2.0pre - which is master, which is 1 day past the 1.1.0 release. :) 2011-10-11 16:19:51 -07:00
Mathias Bynens
5e213a872c Merge pull request #805 from samuelcarlton/patch-1
Added sublime-project and sublime-workspace files to ignore list
2011-10-10 21:41:53 -07:00
Sam Carlton
638f77206f Added sublime-project and sublime-workspace files to ignore list 2011-10-10 19:43:28 -05:00
Divya Manian
25fa9bedd7 Merge pull request #800 from jakearchibald/master
Changing IE class names to target browsers less than a version.
2011-10-09 13:40:09 -07:00
Jake Archibald
b230b84043 Changing IE class names to fall-back rather than target specifically.
Almost all layout bugs that exist in IE8 also exist in 6 & 7, almost all layout bugs in 7 exist in 6. With class names that target versions specifically I end up repeating my selectors for IE6, 7 & 8. This pattern of selectors avoids that. Developers should be more familiar with this behaviour, as this is how it works with the underscore & star hacks.

If a style needs to be applied to IE8 specifically, it could be set on .ltie9 then overridden in .ltie8 - this isn't pretty, but I've never had to target a specific IE in practice, so I'm going on the assumption that it's an edge-case.
2011-10-08 11:51:05 +01:00
Paul Irish
362eb87946 Merge pull request #799 from rigelglen/master
Validate 404 Page's HTML
2011-10-07 10:22:41 -07:00
rigelglen
eaf87bb500 Now Valid HTML 2011-10-07 22:20:22 +05:30
Divya Manian
5c85e31a21 Merge pull request #789 from unfinisheddev/master
Ammendment to CSS @import regex. This will now allow media queries like (min-width: 240px).
2011-10-06 06:07:54 -07:00
Dave Kirk
e17dc838a2 Ammended the regex used to match media queries for imported stylesheets as it wasn't matching qeuries containing certain characters 2011-09-26 10:39:07 +01:00
Nicolas Gallagher
3cdf17e1bc Prevent text inputs growing as you type in IE6/7.
Applying *overflow:visible to button/input causes text inputs to
grow to fit their content, even if an explicit, fixed width is
applied. It was originally included to remove excess inner
spacing on buttons and submit/reset/button-type inputs in IE6/7.

Fixing this bug in IE6 requires dropping the fix entirely because
there is no way to avoid it being applied to text inputs. If
there is a need to fix this excess spacing bug in IE6, then it
should be done using a class that is applied to the
necessary elements.

For IE7, the excess spacing fix can be moved into the ruleset
that targets button and submit/reset/button-type inputs. This
prevents text inputs from growing.
2011-09-22 18:47:24 +01:00
Divya Manian
994cd0801d Merge pull request #768 from mathiasbynens/master
.htaccess improvement: check if mod_headers is available before matching webfont files (instead of the other way around)
2011-09-18 07:02:47 -07:00
Divya Manian
e130ae32c2 Merge pull request #767 from whitman/master
Add -p flag to mkdir
2011-09-18 06:58:16 -07:00
Mathias Bynens
d8a3970e14 Check if mod_headers is available before matching webfont files. This tweak also makes it more consistent with the rest of the .htaccess file. 2011-09-18 10:21:33 +03:00
Alex Whitman
d98f4ae88e Add -p flag to mkdir
- Allows parent directories to be automatically created if necessary
2011-09-17 16:18:39 +02:00
Nicolas Gallagher
6673ce68ff Merge pull request #766 from rigelglen/master
Update Demo Pages with jQuery 1.6.4
2011-09-17 02:17:41 -07:00
Rigel Glen
535918a3ed Updated Demo Page with jQuery 1.6.4 2011-09-17 14:41:22 +05:30
Mathias Bynens
32fcb33604 Merge pull request #765 from rigelglen/master
Added jQuery version 1.6.4
2011-09-17 00:59:46 -07:00
Rigel Glen
d13dfdef40 Added jQuery 1.6.4 2011-09-17 13:05:54 +05:30
Rigel Glen
b23de068c5 Added jQuery 1.6.4 2011-09-17 13:03:30 +05:30
rigelglen
7f94518f6b Added jQuery 1.6.4 2011-09-17 12:52:39 +05:30
Vladislav Shkodin
53aded7bf3 added fixed sizes for checkbox and radio button. this will remove extra space around them in IE7 2011-09-16 04:49:49 +04:00
Divya Manian
7a984c7f84 Changing the default elements inside body. Fixes #203 2011-09-15 17:35:35 -07:00
Divya Manian
8aa70882b4 Removing prefixed box-shadow resets in print styles. 2011-09-13 17:48:53 -03:00
Divya Manian
fe2d67c9c0 Merge pull request #754 from lekkerduidelijk/patch-2
Reset box shadow, including vendor prefixes, for @media print.
2011-09-13 13:48:08 -07:00
RL
115bce064e Reset box shadow, including vendor prefixes, for @media print. 2011-09-13 14:06:55 +03:00
Paul Irish
4994e375a1 Merge pull request #748 from santry/patch-1
A couple grammatical fixes to README.md
2011-09-10 15:51:34 -07:00
Sean Santry
64c9e797b8 A couple grammatical fixes to README.md 2011-09-10 18:52:28 -03:00
Paul Irish
ceb6e819d3 Merge pull request #742 from owilliams/master
Fix small typo in createproject.sh
2011-09-06 14:49:44 -07:00
owilliams
ea716a8f46 Fixed small typo in createproject.sh
Fixed small typos in build/createproject.sh comments: "sucess" -> "success"
2011-09-06 18:20:45 -03:00
Mathias Bynens
715957bffc Correct Expires header to application/x-font-ttf. Fixes #740. 2011-09-06 18:43:15 +03:00
Divya Manian
981e448b36 Merge pull request #733 from inxilpro/master
Added project.xml to build process
2011-09-05 07:02:03 -07:00
Divya Manian
439778a2be Updated the readme to remove duplicate reference to modernizr.load Fixes #737 2011-09-04 15:52:12 -07:00
Mathias Bynens
7b3c30d8c8 Merge pull request #736 from philipvonbargen/master
Added new version of jQuery (1.6.3)
2011-09-03 04:54:26 -07:00
Shi Chuan
70a836c34d added new console api methods to console.log protection 2011-09-03 14:02:43 +08:00
Shi Chuan
75ac1ea512 Merge pull request #735 from joeytrapp/master
Modify .esproj ignore rule.
2011-09-01 20:46:59 -07:00
Philip von Bargen
d07c233422 Added new version of jQuery 2011-09-01 22:08:37 +02:00
Paul Irish
bd72320946 Merge pull request #734 from Danmer/master
Set the file encoding for ant
2011-09-01 09:14:36 -07:00
Joey Trapp
2ba5f9d80d Added * to .esproj as Espresso saves the file as [Project Name].esproj. 2011-09-01 08:16:55 -05:00
Egor Kotlyarov
9b32ced2b4 build script: set the default file encoding for ant. Closes #729. 2011-09-01 10:39:19 +06:00
Chris Morrell
a6bc1d4e69 Added project.xml for custom build targets
Added a project.xml file which should be used for custom build targets
that are specific to your project, and updated build.xml to import that
file.
2011-08-31 17:45:04 -04:00
Divya Manian
2df9a9a863 Merge pull request #732 from Zearin/patch-2
Not 100% complete, but added lots of backticks to make files, paths, and
2011-08-29 13:05:23 -07:00
Tony
19dd8f8318 Not 100% complete, but added lots of backticks to make files, paths, and inline code easier to spot (and read!). 2011-08-29 22:04:00 -03:00
Mathias Bynens
4caa411f01 Switch back to the optimized asynchronous Google Analytics snippet.
Don’t set .async = true, since it only makes a difference in Firefox 3.6. See http://mathiasbynens.be/notes/async-analytics-snippet#async for details.

This reverts commit d9cc711ea1 and fixes #720.
2011-08-25 23:02:07 +02:00
Nicolas Gallagher
fccc4824cc Merge pull request #721 from callum85/patch-1
Move media query placeholders to follow immediately after the primary styles, and before the helper classes
2011-08-24 05:44:18 -07:00
callum85
ef3c095baf Moved media queries placeholder immediately after primary (mobile-first) styles... and before the non-semantic helper classes. 2011-08-25 00:22:08 +02:00
Rutger de Knijf
3f22747dfb Changed -rev target description and renamed to -intro 2011-08-23 10:11:56 +03:00
Paul Irish
ca028d751f Merge pull request #716 from rdeknijf/master
build.xml -rev target clarity
2011-08-22 13:24:37 -07:00
Divya Manian
97c7ae774a adding .esproj to gitignore. Fixes #709 2011-08-21 10:40:31 -07:00
Divya Manian
6727b542ac changing hash length to 7 from 40 2011-08-21 10:24:25 -07:00
Matthew Donoughe
ad423ae3fd add hash.length property to control hash lengths
re: issue gh-696
2011-08-21 16:39:00 +00:00
Paul Irish
e88011b49b closure compiler. renamed the jar. fixup of 3233fdeeec 2011-08-20 22:42:46 -07:00
Divya Manian
01f0a9f999 Adding * to scope zoom to only IE6,7. fixes #710 2011-08-20 20:08:52 -07:00
Divya Manian
d2223de26a Merge branch 'master' of https://github.com/roblarsen/html5-boilerplate into closurecompiler 2011-08-20 19:44:44 -07:00
Rob Larsen
8cbb3e7155 moved the two options (warning_level and compilation_level) into the properites files 2011-08-17 22:03:33 -04:00
Paul Irish
7467f9c041 script.js and style.css both retain their path prefix when being swapped out for the concatenated/minified versions.
by @darktable.
https://github.com/paulirish/html5-boilerplate/pull/705

fixes #705.

Squashed commit of the following:

commit 6a77f5ad7e
Author: calvin <calvin@darktable.com>
Date:   Tue Aug 16 21:12:10 2011 -0700

    adding file.root.script property to default.properties

    this allows people to rename script.js and not have to hack through
    build.xml to keep everything working.

commit 27011c0a1a
Author: calvin <calvin@darktable.com>
Date:   Tue Aug 16 20:51:48 2011 -0700

    revert to normal css and js paths

    had testing paths in the previous commit.

(and some other merge happiness)
2011-08-17 16:14:07 -07:00
Rob Larsen
3233fdeeec issue #658 switch to Closure Compiler for js minification 2011-08-17 12:42:24 -04:00
Paul Irish
2aabc1a276 Merge pull request #697 from nwtn/master
Typo in index.html
2011-08-16 12:22:21 -07:00
David Newton
c8b87abd01 Comment typo: "an manifest" -> "a manifest" 2011-08-16 15:14:10 -03:00
Divya Manian
94b065fb97 okay so it uses the css.sha to replace just style.css to sha.css now 2011-08-15 23:51:52 -07:00
Divya Manian
9fe23b3f82 removed css prefixers, doing this with regex now. Updated regex to not add another /css/ 2011-08-15 23:37:13 -07:00
Paul Irish
c4ef2f3810 build script: tweak script replacement regex for whitespace. Thank You @kevva !
@kevva wins the award for fastest bug report. 118 minutes after a bug was committed,
  he reported it in #html5. And then I was a dunce and couldn't identify the fix
  and so he provided that too.

Not a trivial bug either.

Best bug reporter ever. :D

--

This is a fix for 2fb6ac3369...bf52178981 (L2R62)
2011-08-15 11:52:53 -07:00
calvin
2fef4ad3ee concatenated style.css retains the prefix from the pre-concat style.css.
fixes #686
2011-08-15 10:43:58 -07:00
Paul Irish
20976f7af4 minor. comment wording cleanup. 2011-08-15 10:39:06 -07:00
Paul Irish
64561534a6 kill off misleading css concat statements. build script docs will more clearly illuminate how css concat/importing works.
fixes #687
2011-08-15 10:10:08 -07:00
Paul Irish
bf52178981 Merge pull request #685 from drublic/master
Prefixing CSS/JS resources automatically, idea from @drublic, technique from @darktable
2011-08-15 09:42:11 -07:00
drublic
e1702af5ee Make gae_css.dir property available to use prefixes for any build type
Thanks to @darktable for commit 67d427c1a9

Signed-off-by: drublic <hans@sa-designz.de>
2011-08-15 10:09:04 +02:00
drublic
014b6d4153 Revert "Add option to prefix CSS and JS references in buildscript"
This reverts commit b139b59797.

Signed-off-by: drublic <hans@sa-designz.de>
2011-08-15 10:05:47 +02:00
drublic
b139b59797 Add option to prefix CSS and JS references in buildscript
Syntax: add `(prefix: /file/to/dir/)` in comment before reference
Signed-off-by: drublic <hans@sa-designz.de>
2011-08-14 20:53:16 +02:00
drublic
6c1e80d6dd Whitespace in comments surrounding CSS and JS references
Add whitespace before closing tags of comments surrounding CSS and JS references to maintain consistency with other comments

Signed-off-by: drublic <hans@sa-designz.de>
2011-08-14 20:50:52 +02:00
Paul Irish
2fb6ac3369 Merge pull request #682 from anthracite/cleanup
whitespace .. global code cleanup.. random protip: I use `git gui blame filename.ext` because the git gui has a Blame Previous Commit feature so i can go back beyond the blame commit it found. Useful with commits like this.
2011-08-14 11:25:49 -07:00
Martin Balfanz
50daa07400 Added blank lines to script.js 2011-08-14 20:18:14 +02:00
Mathias Bynens
b44a12d78c Enable gzip compression for favicons. Closes #684. 2011-08-14 11:04:32 +03:00
Martin Balfanz
fa785e0ef0 global code cleanup
includes: - tab removal from html/css
          - fixing indention
          - removing unnecessary whitespaces
2011-08-13 16:19:01 +02:00
Nicolas Gallagher
c86f2b52c0 Remove excess space around radio and checkbox in IE8/9 2011-08-13 02:55:02 +01:00
Paul Irish
0062417c59 Merge pull request #681 from philipvonbargen/master
@import url() starting with // did break build process
2011-08-12 08:53:05 -07:00
philipvonbargen
98e4ca1edf @import urls in the CSS starting with "//" were breaking the build process 2011-08-12 17:31:31 +02:00
Mathias Bynens
21933ec1ee Simplify .gitattributes. Thanks, @jeffbyrnes! See 7f31896fd4 (commitcomment-525963) for more details. 2011-08-11 14:29:58 +03:00
Mathias Bynens
85d8cc0ac0 Check if mod_autoindex.c is available before disabling the Indexes option. Fixes #676. Thanks, @sstok! 2011-08-11 12:42:35 +03:00
Nicolas Gallagher
1311138f3e Update monospace font stack fix to work in Safari 4 2011-08-11 10:40:27 +01:00
Divya Manian
1b3690933e Merge pull request #671 from chendrix/master
Clarified the wording on the new Modernizr build with Respond.js
2011-08-10 15:32:45 -07:00
Christopher Hendrix
b87096669b Clarified wording on the custom Modernizr build containing Respond.js 2011-08-10 18:29:28 -04:00
Paul Irish
7344d57029 Merge pull request #669 from SlexAxton/master
Defer chromeframe too.
2011-08-10 12:17:32 -07:00
Alex Sexton
060315b591 Add the defer attribute to the CF scripts at the bottom. 2011-08-10 14:12:08 -05:00
Divya Manian
5f2b327595 Adding Gavrismo to contrib list 2011-08-10 10:30:43 -07:00
Paul Irish
1e79f7b7df update readme. :) 2011-08-10 00:17:59 -07:00
Paul Irish
c6dbb2892b appcache improvements. :) details below:
* reduce extra code via <isset>
* `manifest` becomes its own ant task now
* html files are populated into the manifest based on ant config
* add manifest attribute to the HTML tag via Ant. So only the config switch is neccessary
* appcache back to disabled by default. toggling it on in config/project.properties is all that's neccessary
2011-08-09 23:07:03 -07:00
Paul Irish
c996f0e685 manifest: js files now include path, correctly. manifest file now named manifest.appcache. 2011-08-09 22:09:45 -07:00
Paul Irish
f10f81a241 build script: manifest improvements (and others).. details:
manifest:
* use a manifest template from build/config/cache.appcache each time
* the only css we are dropping in is the style.css (SHA'd), no more
* we include all js/mylibs/bypass files and all js/libs/*.min.js files
* change default name of manifest to `cache.appcache` but im gonna change it to `manifest.appcache` next commit ;)
* state of repo temporarily includes a manifest but that will revert soon

other:
* rename libs-concat.js to mylibs-concat.js for logic's sake
* add @defer attribute to concated script
2011-08-09 21:59:47 -07:00
Paul Irish
00be05ad18 minor. whitespace in build script following manifest commit (with tabs! omg!) 2011-08-09 19:53:52 -07:00
Nicolas Gallagher
5fe1dda97c Make .hidden class more robust. Update a couple of helper class links to point to better and/or more up-to-date explanations. 2011-08-10 02:10:06 +02:00
calvin
113c98f849 excluding the mylibs directory was preventing minification/concatenation of libs. 2011-08-09 16:50:46 -07:00
Paul Irish
341992913b Merge pull request #652 from gmoulin/master
appcache manifest generation via Ant
2011-08-09 16:49:07 -07:00
Mathias Bynens
1c9145c9a7 Correct Modernizr reference in the test file. Fixes #662. Thanks @jaimie-van-santen! 2011-08-09 15:46:33 +03:00
Mathias Bynens
e13f5c4b37 Add a note saying php_flag expose_php Off should be moved to php.ini since it doesn’t work in .htaccess files. Closes #611. 2011-08-09 10:25:10 +03:00
Paul Irish
d9cc711ea1 google analytics now uses Modernizr.load/yepnope for great justice. fixes #542 2011-08-08 23:03:16 -07:00
Paul Irish
55a7fc2466 Merge pull request #646 from ngryman/master
generic rewrite rules (for virtual host context)
2011-08-08 22:52:06 -07:00
Paul Irish
99e140ded4 Merge pull request #659 from Zearin/patch-1
Mostly lots of <code> additions for consistency.  (I think it also
2011-08-08 08:34:37 -07:00
Tony
b77d30c2f0 Mostly lots of &lt;code&gt; additions for consistency. (I think it also enhances readability, so inline code snippets are obvious.) Few minor capitalization & typographical fixes. 2011-08-08 11:46:58 -03:00
Paul Irish
b191777977 @import inlining should skip anything starting with http.. fixes #657 2011-08-07 18:28:54 -07:00
Divya Manian
6241a72722 Fixing typo in .htaccess file 2011-08-07 18:23:52 -07:00
Paul Irish
2db692e752 build script. flexibility in @import syntax parsing. fixes #649 forreal forreal 2011-08-05 09:20:29 -07:00
Guillaume Moulin
6c5b7719a6 optionnal manifest declaration 2011-08-05 13:44:00 +02:00
Guillaume Moulin
a314d2a374 modifications for manifest awareness in build.xml
with variables in project.properties for handling manifest file name,
javascripts files names and stylesheets files names

the javascripts files will be replaced by the concatened and minified
version
idem for the stylesheets
2011-08-05 13:24:11 +02:00
Guillaume Moulin
a81061aa37 modifications for manifest awareness in build.xml
with variable in project.properties for handling manifest file name

the javascripts files replaced are those concatened and minified by the
build
idem for the stylesheets
2011-08-05 13:00:13 +02:00
Guillaume Moulin
0d4f6b5261 Merge remote-tracking branch 'upstream/master'
Conflicts resolved:
	build/build.xml
	index.html
2011-08-05 10:58:57 +02:00
Guillaume Moulin
a556e26cb5 changes for site.manifest awareness 2011-08-05 10:50:39 +02:00
Paul Irish
cde1dc4f5c build script. flexibility in @import syntax parsing. fixes #649 2011-08-04 17:13:23 -07:00
Paul Irish
601fbc59e4 build script. flexibility in @import syntax parsing. fixes #649 2011-08-04 16:41:53 -07:00
Paul Irish
28b1ca4b8c build script. slightly cleaner css comment style, because we can. credit: darktable, again. 2011-08-04 16:39:46 -07:00
Nicolas Gallagher
ce89a01bef Separate [hidden] from .hidden helper class. Slight tidy up of CSS comments and consistently use h5bp.com shorturl throughout the file 2011-08-03 10:44:29 +01:00
Nicolas Gallagher
7b95c57e2d Remove webkit-overflow-scrolling inserted after a merge. See #577 2011-08-03 09:34:55 +01:00
Nicolas Gallagher
44bc2bdbf2 Leave default webkit-tap-highlight-color in place. Modify vertical alignment of td. Add a:hover color. 2011-08-03 09:32:56 +01:00
Nicolas Gryman
00d8b84570 generic rewrite rules (working in virtual host context) 2011-08-02 18:12:28 +02:00
Paul Irish
458cd36309 build script. protect legacy stylesheets from being consumed and digested by the css-split task. thx darktable. 2011-08-01 23:43:52 -07:00
Paul Irish
586dc13ee3 build script. update @import regex for max compat. 2011-08-01 23:08:23 -07:00
Paul Irish
4238aed87d Merge branch 'css-split' 2011-08-01 22:49:13 -07:00
Paul Irish
a48bd3ebaf Merge branch 'css-split' of https://github.com/darktable/html5-boilerplate into css-split 2011-08-01 21:29:32 -07:00
calvin
19450d9d59 using ==|== syntax to mark export delimiters 2011-08-01 21:21:38 -07:00
calvin
7fca5a5adf using ==|== syntax to mark export delimiters 2011-08-01 21:20:59 -07:00
Paul Irish
7668263695 improved gzip detection for turtletappers. thx @bluesmoon and @marcelduran. fixes #624 2011-08-01 14:40:11 -07:00
Paul Irish
d15376de77 merge in latest darktable. 2011-08-01 13:20:59 -07:00
Mathias Bynens
413822acbc Update demo pages so they use the smaller viewport <meta>. 2011-08-01 15:03:18 +02:00
calvin
11158f1bc4 the css-split method was using @import syntax that isn't standard. 2011-07-31 22:50:25 -07:00
calvin
0b15ec7d6d now the "url" chunk of the @import is optional. 2011-07-31 22:29:19 -07:00
calvin
05d83fcfeb there was a rogue "url" in the replacement regexp. 2011-07-31 22:13:40 -07:00
Gavrisimo
53f28cf87d moved border rule to .ir ruleset 2011-08-01 11:53:58 +08:00
Gavrisimo
4c9e90e730 added small fix for buttons and inputs that have .ir class 2011-08-01 11:53:58 +08:00
Jonathan Fielding
c537194736 jQuery updated to 1.6.2 2011-08-01 11:53:58 +08:00
Rob Larsen
fd345072df Added a task to test for ant version and fail (with instructions) if it's below 1.8.2. 2011-08-01 11:53:57 +08:00
meleyal
51d121e79a fix formatting 2011-08-01 11:53:57 +08:00
meleyal
777f14fa93 remove redundant color rule 2011-08-01 11:53:57 +08:00
meleyal
0a7a6f82bf also use black for links when printing, refs #147 2011-08-01 11:53:57 +08:00
Robert Ros
2792309862 Use substring matching in gzip filter_module and re-enable gzip for some common MIME-types 2011-08-01 11:53:56 +08:00
Robert Ros
976fc0f9ba Workaround for broken regexes in mod_filter
More info: #549
Fixes: #441 #499 #535
2011-08-01 11:53:56 +08:00
darktable
aee2fa8f29 fixes issue where I was including the for task using a namespace 2011-07-31 20:41:05 -07:00
Paul Irish
73f6f66039 minor. buildscript whitespace. 2011-07-31 19:51:50 -07:00
Paul Irish
e7e087854b merged in darktable's css-split branch. 2011-07-31 19:05:13 -07:00
Paul Irish
b14b4a60d1 Normalize javascript mimetype to application/javascript. Reduces cruft. Thx @danbeam for the work. Fixes #485 2011-07-31 18:50:38 -07:00
Paul Irish
8b168ad3b1 Merge pull request #642 from roblarsen/master
two changes for issue  #615
2011-07-31 18:49:20 -07:00
Rob Larsen
f2f59b04ec added a quick example to the file.bypass.js explanation 2011-07-31 19:44:10 -04:00
Paul Irish
727ef92941 htmlcompressor up to 1.4.3 because he fixed #550, #641 for us. \o/ 2011-07-31 15:23:01 -07:00
Mathias Bynens
5c97f98709 Smaller viewport <meta> — 1 is the new 1.0. 2011-07-31 23:32:30 +03:00
Paul Irish
41246db22b build script: htmlcompressor preserves SSI comments by default. fixes #640, #503. 2011-07-31 12:06:15 -07:00
Rob Larsen
3611b4c4e0 issue 615 "files.bypass does not work." It was a case of unraveling where/when the scripts were getting copied over and changing the way, slightly, that the excluded file list was fed to the script. 2011-07-31 09:12:28 -04:00
Nicolas Gallagher
299291e6be Add defer where possible to demo page scripts. Ref #542 2011-07-31 11:26:32 +01:00
Nicolas Gallagher
0d1c066177 Update demo pages to use modernizr 2.0.6 custom build including respond.js 2011-07-31 11:01:32 +01:00
Paul Irish
ffb7b8e359 update to htmlcompressor 1.4.2. fixes #608 2011-07-30 20:11:42 -07:00
Paul Irish
401e66acb4 script defer added where possible. H5BP is now faster!! thx @beverloo. fixes #542 2011-07-30 20:05:07 -07:00
Paul Irish
e49793fdc9 upgrade modernizr to 2.0.6 custom build including respond.js. 2011-07-30 19:53:03 -07:00
Paul Irish
a36c13a732 update the (disabled) SSI for better windows compatibility. fixes #628. code from @aldomx. 2011-07-30 19:40:59 -07:00
Paul Irish
9a6433f92f Vary: User-Agent is no more. We send our X-UA-Compat to everyone, but only for html payloads.. fixes #414 2011-07-30 19:22:39 -07:00
Paul Irish
bd88d3e457 update htmlcompressor to 1.4.1 from 1.1. Outstanding issue upstream but tracked in #608 2011-07-30 19:21:29 -07:00
Paul Irish
58816dd249 golf down the size of @kirbysayshi's log() improvement. ref #498.
I steal log's apply method instead of reaching all the way into Function.prototype.apply.. timesaver and bytesaver. just really ugly.
And then a nasty ( omg ? ternary : action); as a statement. But hey.. sometimes you feel like a nut.

kirby, plz code review this. :p
tested in Chrome 14.
2011-07-30 17:32:47 -07:00
Paul Irish
8175a1c468 console.markTimeline() is now console.timeStamp(). http://webk.it/63317 2011-07-30 17:19:20 -07:00
Paul Irish
ebe10aef34 improve the console.log nerfing for ff3.6. thx @drewcovi. fixes #455 2011-07-30 17:19:20 -07:00
Paul Irish
e52f6af093 Merge pull request #498 from kirbysayshi/master
log() arguments are no longer wrapped in extraneous array
2011-07-30 17:19:04 -07:00
Nicolas Gallagher
559bc56768 Re-fix IE6/7 list-style:none problem. See #263 2011-07-30 15:56:26 +01:00
Mathias Bynens
78641b530f Change the short URL for more <head> tips to something that works in all browsers. Fixes #631. 2011-07-27 19:55:38 +03:00
Paul Irish
6fee66d751 more docs for php_flag html_errors Off. thx @leek. fixes #622 2011-07-23 19:25:54 -07:00
Shi Chuan
c23caaf1d8 #614 changed replace directory to intermediate 2011-07-24 01:24:03 +08:00
Paul Irish
b4229a4d49 Merge pull request #619 from Phize/patch/3
allow access from all domains for .ttc webfont.
2011-07-22 10:56:05 -07:00
Phize
3f3f95de4e allow access from all domains for .ttc webfont. 2011-07-23 02:08:21 +09:00
Phize
acdae81735 add settings for Atom. 2011-07-22 10:00:53 -07:00
Nicolas Gallagher
7f52ddf680 Reintroduce search input normalization. Avoids significant WebKit styling limitations. 2011-07-22 17:22:49 +01:00
Nicolas Gallagher
dc1604c697 Ensure IE6 applies styles for <audio>, <canvas>, and <video>; ensure modern browsers hide <audio> without controls 2011-07-20 20:38:37 +01:00
Nicolas Gallagher
d965db4c5e Add {background-color: transparent} to .ir helper class. Removes default background-color from elements like <button>. Ref #609 2011-07-20 14:56:51 +01:00
Nicolas Gallagher
f78016f555 Make HTML5 [hidden] attribute hide an element from screenreaders and browsers that support the attribute selector. Close #607 2011-07-20 14:27:48 +01:00
Mathias Bynens
c72a81c5e9 Use example.com instead of domain.com, as per RFC 2606. Fixes #613. 2011-07-20 02:03:51 -07:00
Mathias Bynens
639cb05ba0 Typo. Fixes #612. 2011-07-19 23:16:45 -07:00
Nicolas Gallagher
5416bcd103 Add {resize: vertical} to <textarea> 2011-07-16 11:46:46 +02:00
Divya Manian
37446e28af Merge pull request #599 from Gavrisimo/master
Fix buttons and inputs that have .ir class attached
2011-07-12 10:09:09 -07:00
Nicolas Gallagher
a709725b06 Set {overflow:auto} for <button> and <input> in <table> in IE6/7. Avoids numerous layout and whitespace issues that result from setting {overflow:visible} to fix the odd inner spacing of those form elements. 2011-07-12 14:00:11 +02:00
Nicolas Gallagher
d3dc77b211 Add link to CSS wiki in style.css. Close #575 2011-07-12 13:54:04 +02:00
Mathias Bynens
7db1acaeb5 Follow the H5BP coding style guidelines for quotes. http://h5bp.com/docs/#The-markup 2011-07-11 03:00:55 -07:00
Gavrisimo
29c7e128cd moved border rule to .ir ruleset 2011-07-09 21:32:23 +02:00
Gavrisimo
09a8c715cb added small fix for buttons and inputs that have .ir class 2011-07-09 20:53:16 +02:00
Divya Manian
536b6ace6b Merge pull request #595 from rros/master
Modify apache mod_deflate .htaccess triggers
2011-07-06 06:20:28 -07:00
Mathias Bynens
f4a43fd2e4 Merge pull request #596 from jonathan-fielding/master
jQuery Updated to 1.6.2
2011-07-06 04:17:30 -07:00
Jonathan Fielding
c80cc610e2 jQuery updated to 1.6.2 2011-07-06 12:15:11 +01:00
Robert Ros
fca04b1e3e Merge remote-tracking branch 'rmsr/master'
Conflicts:
	.htaccess
2011-07-06 00:48:08 +02:00
Divya Manian
e150d87944 updating csslint to latest version 2011-07-05 15:26:41 -07:00
Divya Manian
b131981d84 Now you can set images.bypass with a list of image files or folders within the img directory that you do not want to be optimized. Fixes #564 2011-07-04 13:56:44 -07:00
Divya Manian
d19dea0572 1. Added a bypass option that lets you bypass certain folders/files in mylibs dir. 2. Cleaned up the human error fix from yesterday to use if else conditions like rest of the targets. 3. Cleaned up usage of mylibs to refer to dir.js.mylibs everywhere 2011-07-04 12:54:51 -07:00
Divya Manian
f5e2524c96 Merge pull request #593 from roblarsen/master
Test for ant version to head off problems with ant < 1.8.2
2011-07-04 07:55:01 -07:00
Rob Larsen
3fb77e0cfa Added a task to test for ant version and fail (with instructions) if it's below 1.8.2. 2011-07-04 10:04:45 -04:00
Divya Manian
e3367bc021 removing concatinated css files from wherever they are linked to with link tag. Fixes #452 2011-07-04 01:42:37 -07:00
Divya Manian
e12930a242 removing unnecessary check on -clean for -invalid 2011-07-04 01:01:25 -07:00
Divya Manian
8e0864f509 with great trepidation I have tested this build conditions to make sure these values ., .., ./, ../, / for dir.publish do not result in a successful build. I have tested all the combinations. Fixes #393 2011-07-04 00:49:33 -07:00
Paul Irish
93f0e38c51 update chromeframe install to 1.0.3. thx @davidmurdoch. 2011-07-01 12:27:19 -04:00
Nicolas Gallagher
705493215e Merge pull request #586 from meleyal/print-styles
Use black for links when printing, refs #147
2011-07-01 09:13:48 -07:00
meleyal
02e749a3f4 fix formatting 2011-06-29 22:58:33 +02:00
meleyal
d9146777db remove redundant color rule 2011-06-29 22:52:19 +02:00
Paul Irish
f7da334d36 Merge pull request #589 from BrunoDeBarros/master
csslint without whitespace
2011-06-29 13:03:44 -07:00
Bruno De Barros
8628fef73e csslint
Does the same as https://github.com/paulirish/html5-boilerplate/pull/567 but without the whitespace, as per @paulirish's request.
2011-06-29 20:58:36 +01:00
meleyal
35872f2e58 also use black for links when printing, refs #147 2011-06-29 13:00:10 +02:00
Mike Almond
ddd7ae43a5 Updating TTF mimetype to fix Google Chrome warning 2011-06-28 20:46:08 -07:00
Divya Manian
954d45cbcb added vertical-align: middle to fix borders on image containers. Fixes #440 2011-06-28 20:29:49 -07:00
Paul Irish
f569ad9813 Merge pull request #585 from rros/master
Workaround for bug in mod_filter

Fixes #441. Fixes #499. Fixes #535.
Closes #549. (the grouping ticket)
Ref #576 (the similar PR)
2011-06-28 17:25:47 -07:00
Robert Ros
210fbe0947 Merge remote-tracking branch 'upstream/master' 2011-06-29 01:13:10 +02:00
Robert Ros
86581681eb Use substring matching in gzip filter_module and re-enable gzip for some common MIME-types 2011-06-29 01:12:12 +02:00
Paul Irish
26a391c60d Revert "Added native iOS inertia scrolling" Details below:
We had discussion here: fbfbbd5dad
and here: https://github.com/paulirish/html5-boilerplate/pull/577

And @irae's explanation helped clarify why this is a bad call as a default:
https://github.com/paulirish/html5-boilerplate/pull/577#issuecomment-1444977

Thanks everyone for weighing and sorry for jumping on the excitement train a bit too fast! :)

This reverts commit 14ba59535e.
Ref #577
2011-06-26 22:26:18 -07:00
darktable
b125225228 added css-split task to split a tagged css file into multiple files
added 'css-split' task to build.xml and changed style.css back to the main version, with "- h5bp-export: filename - " tags in it to allow automated splitting into root file with @imports and satellite files.
2011-06-26 13:15:14 -07:00
Nicolas Gallagher
b61671ccc6 Merge pull request #580 from thatcoolguy/master
Format svg ruleset the same way other rulesets are formatted
2011-06-26 09:43:17 -07:00
Frank
91f39213da changed svg formatting 2011-06-26 12:48:44 -03:00
darktable
036b1e5e4b more robust @import regexp. 2011-06-25 22:15:08 -07:00
darktable
401250356e swapped style.css for property name ${file.root.stylesheet}
swapped to property name to make the build process more flexible.
2011-06-25 20:08:14 -07:00
darktable
2d09367d64 another experimental method for concatenating css files
This build converts the @import statement in style.css to tags that are then swapped for the file contents.
It also converts the media types after the import to @media ... {} style tags.
2011-06-25 19:38:14 -07:00
darktable
0928889ddc new way to concat css files together
adding css/concat directory with the css files named in the order they should be included.
the build script then concats these files in alphabetical order and replaces their block with the concated file using the same method as the .js swap (looks for the surrounding comments).
2011-06-25 12:53:03 -07:00
Paul Irish
fbfbbd5dad Merge pull request #577 from joeybaker/master
Added native iOS inertia scrolling (avaliable in iOS5 beta2)
2011-06-25 12:28:32 -07:00
Joey Baker
14ba59535e Added native iOS inertia scrolling (avaliable in iOS5 beta2) 2011-06-25 12:11:28 -07:00
Robert Ros
6edd2cb9b2 Workaround for broken regexes in mod_filter
More info: #549
Fixes: #441 #499 #535
2011-06-25 11:55:11 +02:00
Mathias Bynens
5e26749118 Encourage people to send the X-UA-Compatible HTTP header instead of leaving it in the HTML, to avoid edge case issues. Fixes #378. 2011-06-24 12:00:32 -07:00
Paul Irish
b84c9aeb50 Merge pull request #573 from retlehs/master
protocol-relative URL for Chrome Frame install prompt
2011-06-23 22:39:52 -07:00
Ben Word
4c8e51a459 protocol-relative URL for the Chrome Frame install prompt 2011-06-23 23:08:35 -06:00
Paul Irish
8ace459e0e move chromeframe to bottom of page after the other scripts. also reference exact version # for higher expires headers. 2011-06-23 21:13:25 -07:00
Paul Irish
c03be7e137 Merge pull request #572 from adeelejaz/upstream
Prompt IE 6 users to install Chrome Frame. #495
2011-06-23 21:09:24 -07:00
Adeel Ejaz
bca1d30716 Prompt IE 6 users to install Chrome Frame. #495 2011-06-24 01:47:06 +01:00
Paul Irish
82c2125692 Merge pull request #570 from botskonet/master
very minor gitignore additions of textmate project folder, and older CVS folders
2011-06-23 09:20:48 -07:00
Mike Botsko
5572931889 adding back in lost sass_cache gitignore 2011-06-23 08:58:18 -07:00
Shi Chuan
b37d518d81 removed trailing slash redirects in htacess
a wiki page is created for people who want to use it: https://github.com/paulirish/html5-boilerplate/wiki/Proper-usage-of-trailing-slash-redirects
it is also under the Make it better section of the wiki https://github.com/paulirish/html5-boilerplate/wiki/Make-it-better
this has been discussed at many issues/tickets/mailinglist posts #493 #515
2011-06-23 22:57:34 +08:00
Paul Irish
d5d05a36cd if you type <input type=search> then you're getting a search input. ohmagawd. 2011-06-22 21:21:02 -07:00
Mike Botsko
94c63ee571 adding textmate project and CVS folders to gitignore 2011-06-22 15:21:35 -07:00
Nicolas Gallagher
b49ca17032 Add <svg> overflow fix for IE9. Group <img> and <svg> rules in an 'embedded content' section of CSS file. Add {cursor:pointer} to <label> element. 2011-06-21 18:53:11 +01:00
Nicolas Gallagher
6aba703c89 Add <img> and <svg> to elements.html 2011-06-21 18:49:34 +01:00
Nicolas Gallagher
73b878bf9e Merge branch 'master' of github.com:paulirish/html5-boilerplate 2011-06-21 00:36:34 +01:00
Nicolas Gallagher
ddaf66a515 Major: Now using css normalization instead of css reset + building up default styles
We're pulling in http://github.com/necolas/normalize.css/ developed by Nicolas Gallagher along with Jonathan Neal.

normalize.css retains useful browser defaults and includes several common fixes to improve cross-browser (desktop and mobile) styling consistency.

Lots of research has gone into normalize, verifying what are the default user agent styles provided by each browser. We can very specifically change only the ones we need to instead of the bulldozer approach.

Why this is great news:

* Who likes being so damn redudant and declaring: em, i { font-style: italic; }
* By using normalization instead of a reset + building up default styles, we use less styles and save bytes
* Less noise in your dev tools: when debugging, you don't have to trawl through every reset selector to reach the actual style that is causing the issue.
* More details here: http://necolas.github.com/normalize.css/

We're really happy to get user feedback on this, as we think style normalization is a better direction than resetting; and want to make sure you do too. :) Leave a comment here or in the Google Group: http://h5bp.com/group

Fixes #412
Fixes #500
Fixes #534
Closes #456

Links #566
2011-06-21 00:34:58 +01:00
Nicolas Gallagher
e9f342b91f Update HTML elements demo: reduce repetition, remove deprecated elements, add certain HTML5 elements, add more comprehensive collection of HTML5 input types, include different form markup styles, add form elements box-sizing test 2011-06-20 22:11:06 +01:00
Paul Irish
6d8a8ef805 Merge pull request #548 from darktable/master
minify css and js files that are not being concatenated and fix optipng reference.
2011-06-20 11:21:45 -07:00
Divya Manian
31025414e9 Merge pull request #568 from disusered/master
.htaccess comment normalization & ignore .sass-cache in Git
2011-06-20 09:58:41 -07:00
Carlos Rosquillas
4f2003b5fe Added SASS Cache to git exclusion list 2011-06-20 09:39:18 -07:00
Carlos Rosquillas
bfe9a84023 Modified htaccess for consistent capitalization and comment style 2011-06-20 09:35:34 -07:00
Nicolas Gallagher
929eeccc5f Add simpler escape for to demo html files 2011-06-19 23:42:14 +01:00
Paul Irish
2f370b8156 Merge pull request #565 from toddhgardner/patch-1
Added DOCTYPE so Eclipse and other IDE's do not complain about the lack o
2011-06-16 21:45:17 -07:00
toddhgardner
d97a2ff818 Added DOCTYPE so Eclipse and other IDE's do not complain about the lack of schema.
http://stackoverflow.com/questions/363768/disable-dtd-warning-for-ant-scripts-in-eclipse
2011-06-16 20:20:39 -07:00
Nicolas Gallagher
ff68f939b6 Merge branch 'master' of github.com:paulirish/html5-boilerplate 2011-06-15 23:12:45 +01:00
Nicolas Gallagher
1a54c57370 Remove unnecessary units from 0 values in box-shadow. Remove unnecessary h1-6 {font-weight:bold} declaration. Improve white-space consistency. 2011-06-15 23:12:01 +01:00
Mathias Bynens
0b5d68c0af Merge pull request #559 from rdeknijf/patch-1
typo
2011-06-14 08:31:06 -07:00
rdeknijf
bec3000690 typo 2011-06-14 08:25:26 -07:00
Nicolas Gallagher
bc1b720915 Switch to outline:0 for accesible focus treatment. Avoids Opera bug when combined with transitions. Also saves bytes. 2011-06-14 12:35:03 +01:00
Nicolas Gallagher
dab7d7ebc7 Merge pull request #557 from johnattebury/master
Correct comment typo
2011-06-12 03:11:10 -07:00
John Attebury
b4432895b5 typo 2011-06-12 00:32:35 -05:00
Mathias Bynens
7610e41dad Typo. 2011-06-08 11:29:16 -07:00
Mathias Bynens
b10c7c04c4 Simpler escape for </script>. See http://mths.be/etago for more information. 2011-06-07 13:32:25 -07:00
Paul Irish
83f3d6ab09 move tap-highlight to hang with the other hot pinks. 2011-06-06 19:17:47 -07:00
darktable
ef41c51637 updating windows optipng and jpegtran paths to include ${basedir} 2011-06-06 13:47:42 -07:00
darktable
a2c89c0964 removed duplicated block. 2011-06-06 10:18:15 -07:00
Calvin Rien
dc31d7c852 build doesn't fail in mylibs directory doesn't exist.
removed undefined property from css swap regexp.
2011-06-06 10:13:48 -07:00
Calvin Rien
e02dd35b51 minification affects all .css and .js files in /css and /js dirs,
not just the ones explicitly included in concatenation.

using a more flexible regexp to replace style.css in html files.
2011-06-06 10:00:20 -07:00
Audioname
452c2836b2 Merge branch 'master' of github.com:darktable/html5-boilerplate
Conflicts:
	build/build.xml
2011-06-06 09:49:13 -07:00
Audioname
2834081fac Merge https://github.com/paulirish/html5-boilerplate 2011-06-06 09:42:41 -07:00
Mathias Bynens
7f31896fd4 Add .gitattributes. 2011-06-06 08:51:25 +02:00
Divya Manian
9cba6fcae9 Merge pull request #547 from thatryan/patch-1
Removed comment stating closing media query comment was required for respond.js
2011-06-05 00:41:27 -07:00
Ryan
26463fe491 Removed comment stating closing media query comment was required for respond.js. 2011-06-05 00:39:04 -07:00
Mathias Bynens
0a3456758b Fix typo. 2011-06-04 06:06:25 -07:00
necolas
ab3abb63db Update Respond.js to improved, comment-free version. Remove the CSS comments that the old version of Respond required. 2011-06-02 18:48:21 +01:00
necolas
4504c11445 Update demo files to reference Modernizr 2.0 2011-06-02 18:44:29 +01:00
Mathias Bynens
695d2ca304 Encourage people to use a custom Modernizr build containing only the features they need for that particular project. 2011-06-02 01:43:38 -07:00
Mathias Bynens
7b37e95341 Merge pull request #543 from daylerees/master
Modernizr 2.0 Update.
2011-06-02 01:39:32 -07:00
Dayle Rees
7227e7fb27 Updated to Modernizr 2.0 Complete, Production minified. 2011-06-02 09:28:54 +01:00
darktable
fdbbc12871 merging from main 2011-05-31 20:48:42 -07:00
Paul Irish
bad4fb5288 build script: compress all images in subfolders, too. thx calvin rien. 2011-05-30 19:02:45 -07:00
darktable
d9f114c019 added gae.js_dir and gae.css_dir so that App Engine projects can have the correct directory names swapped in their templates.
added a second replace token statement so that "/css/style.css" gets swapped too.
2011-05-30 14:49:12 -07:00
darktable
5c93b03069 swapped "apply rm" for delete task. much faster.
change *.png and *.jpg to **/*.png and **/*.jpg so that optimize commands reach subdirectories.
2011-05-30 14:41:24 -07:00
Ryan Smith-Roberts
c7f763c966 mod_deflate trigger rules modifications
* Add gzip support for xhtml, rss, atom
* Move font & svg compression from FilesMatch to FilterProvider / AddOutputFilterByType
2011-05-28 13:04:07 -07:00
Paul Irish
c24b78462a Merge pull request #530 from brianblakely/patch-1
Issue 482: https://github.com/paulirish/html5-boilerplate/issues/482
2011-05-28 02:06:07 -07:00
brianblakely
3300a6847f Issue 482: https://github.com/paulirish/html5-boilerplate/issues/482 2011-05-27 22:09:28 -07:00
Audioname
347e0c0053 testing123 2011-05-26 15:20:47 -07:00
Audioname
1d0ec96931 Adding properties to project.properties so that
Google App Engine builds don't have "static"
prepended when swapping for minified versions.
2011-05-26 15:02:51 -07:00
Paul Irish
fdb8f6aced Merge pull request #527 from heff/master
Added additional mp4 extensions to MIME types
2011-05-26 11:41:52 -07:00
Steve Heffernan
a30e338dc5 Added m4a (Need it for IE9) and m4v (HandBrake default) MIME types. 2011-05-26 11:18:38 -07:00
Paul Irish
14608f44cf Merge pull request #421 from JoeMorgan/master
Added JSLint target to build script
2011-05-25 15:10:27 -07:00
necolas
cbbaaecc0e Add 'oldie' class to conditional <html> classnames. Fix #522 2011-05-24 20:53:51 +01:00
necolas
7f53f98ec7 Revert "Change our conditional comments around the HTML tag to use a single .oldie class."
This reverts commit e5e057e538.
2011-05-24 20:47:21 +01:00
Paul Irish
b4a91bda9f build script is compatible with php files now. it appears. fixes #392. thx robbyrice. 2011-05-20 14:13:23 -07:00
necolas
e5e057e538 Change our conditional comments around the HTML tag to use a single .oldie class.
http://mathiasbynens.be/notes/safe-css-hacks

We're doing this because that quadruple conditional comment <html> tag definition looks pretty scary and especially when combined with namespace augmenting stuff like Facebook's gross xmlns:fb="http://www.facebook.com/2008/fbml" bullshit.

We are trying to simplify the markup we use in H5BP and a combination of conditional classnames with IE-specific hacks would be much simpler than the markup bloat we currently have.

We'll target IE6 and IE7 specifically with attribute syntax hacks.
http://paulirish.com/2009/browser-specific-css-hacks/


    /* CLEAN NO HACKS */
    div { color: blue; }

    /* HACKS FOR IE */
    .oldie div {
      color: blue; /* IE 8 and below */
      *color: blue; /* IE 7 and below */
      _color: blue; /* IE 6 */
    }

    /* IE6, IE7 - star hack */
    .oldie div { *color: blue; }

    /* IE8 - winning hack */
    .oldie div { color: blue\0/; } /* must be last declaration in the selector's ruleset */

Using these attribute hacks by themselves does not change the selector specificity. If you've worked with a large, long-term codebase, you'll know managing your specificity wisely is critical. Also watch Nicole Sullivan's talks.
2011-05-20 01:32:42 +01:00
Divya Manian
362d0b78d3 Merge pull request #513 from barneycarroll/patch-1
Fix .ir fringe case failure when <br>s are used in the .ir text.
2011-05-19 10:53:22 -07:00
Barney Carroll
bb94ded9f3 Hard breaks in image-replaced text negate the negative text indent. This fix causes line breaks in image-replaced text not to be displayed, fixing the effect. 2011-05-19 08:53:00 -07:00
Shi Chuan
9ee01e94dc moved ETag removal configs closer 2011-05-19 15:10:34 +08:00
Paul Irish
91ff0b8fec Merge pull request #511 from gormus/patch-1
added Header unset ETag
2011-05-18 22:53:23 -07:00
Osman Gormus
1f94b05317 added Header unset ETag
In some servers setting "FileETag None" alone, is not enough. Removing header and setting it to None fixes the issue.
2011-05-18 22:45:11 -07:00
Paul Irish
648026d780 Tweaking our hot pink ::selection based on a suggestion from David Murdoch and research from Adam Diehm.
It is now #fe57a1, which is Festal (adj): pertaining to or befitting a feast, festival, holiday, or gala occasion.

Party!! Party in your webpage! With Festal!!!!

thx also to lexidecimal.com for putting a name to this damn thing and inspiring david to inspire others.
2011-05-18 12:09:51 -07:00
necolas
24f174de59 Fix incorrect paths to Modernizr and Respond in demo pages 2011-05-17 19:24:54 +01:00
necolas
1cec539712 Use minified CDN jQuery by default on demo pages 2011-05-17 19:24:08 +01:00
necolas
b6a8dec0e4 Further quote consistency changes 2011-05-17 19:23:11 +01:00
Paul Irish
0e1c7ba929 Use minified jQuery by default.
While I personally prefer developing with an unminified jQuery (as
it makes debugging easier) I understand that most people don't need that.

So the onus is now on more advanced developers to s/.min.js/.js/
Though they're safe with the build script which will switch the refs back to the min.

And everyone else will default to min'd js, regardless of if they use the
build script.

:)
2011-05-17 09:40:24 -07:00
Paul Irish
f467a7e84b minor whitespace. 2011-05-17 09:38:20 -07:00
Mathias Bynens
c5289aad2b Consistent quotes. Hat tip: @walker. 2011-05-17 09:20:08 -07:00
Paul Irish
4c3301b9cc Merge pull request #505 from jtokoph/master
Fixing broken link to wiki in the changelog
2011-05-16 14:04:23 -07:00
Jason Tokoph
e3d389a171 Fixed URL typo in the changelog 2011-05-16 13:36:59 -07:00
necolas
974d1e2d0b Merge branch 'master' of git://github.com/paulirish/html5-boilerplate 2011-05-15 19:25:58 +01:00
Paul Irish
3522122e31 Merge pull request #502 from sguolin/master
Build script compatibility with Netbeans
2011-05-15 10:59:41 -07:00
See Guo Lin
fb41ccd538 Improved build script compatibility with Netbeans IDE. 2011-05-15 19:15:23 +08:00
See Guo Lin
4bbbfc88de default.properties: added IDE generated files/folders to exclude from build script 2011-05-15 19:14:20 +08:00
See Guo Lin
0c9eec9b52 .gitignore: Filename case correction for Windows generated Thumb.db 2011-05-15 19:13:06 +08:00
necolas
5cad48ced5 Fix #374 2011-05-13 15:39:59 +01:00
necolas
8a3955dae6 Normalize <b> font-weight 2011-05-13 15:05:03 +01:00
necolas
59b993abe9 Update to jQuery 1.6.1 2011-05-13 15:04:11 +01:00
Shi Chuan
b0685726da fixes to pull requests 427 2011-05-13 19:54:50 +08:00
Drew Petersen
0e41abd9e2 formatting style correction 2011-05-12 13:02:27 -04:00
Drew Petersen
caab9d30bd don't wrap all args from log to console.log with array 2011-05-12 12:48:09 -04:00
Nicolas Gallagher
e10e3f04b4 Merge pull request #491 from jphustman/patch-3
typo line 41: buidling a development environment
2011-05-09 01:05:19 -07:00
Jeremey Hustman
98180a91f9 typo line 41: buidling a development environment 2011-05-08 17:50:23 -07:00
necolas
0e2062cb4a Add placeholder CSS MQs for mobile-first approach 2011-05-08 20:50:34 +01:00
necolas
7d792b6845 Add respond.js as part of shift to 'mobile first' approach 2011-05-08 20:42:41 +01:00
necolas
e65c1ad37f Remove icon links in demo files 2011-05-08 20:06:16 +01:00
Divya Manian
9c1188592a Editing the comment for adding touch icons 2011-05-08 11:29:52 -07:00
Divya Manian
1faa76a804 Merge pull request #490 from jamwil/touch-icons
Removing touch icon link tags and retaining only the comment.
2011-05-08 11:28:05 -07:00
James Williams
f4283547f8 Removed redundant icon links and cleaned up the comment 2011-05-08 10:30:16 -06:00
Mathias Bynens
2833b89914 Add Options +FollowSymlinks when RewriteEngine is used. Fixes #489. 2011-05-07 23:42:48 -07:00
James Williams
d284eac8fd Improved the comment. 2011-05-07 22:14:52 -06:00
James Williams
6a71a7e9d5 Added maximum touch-icon support as per http://mathiasbynens.be/notes/touch-icons#sizes 2011-05-07 21:58:28 -06:00
necolas
cf2ee8e826 Update demo tests file 2011-05-07 11:31:54 +01:00
necolas
ef83a0481e Update qunit test page to reference jQuery 1.6 2011-05-07 11:27:31 +01:00
necolas
758f2f4f4c Update elements.html template to match that of index.html 2011-05-07 11:13:37 +01:00
Nicolas Gallagher
e7089e8cf8 Merge pull request #484 from jsma/master
Removed reference to handheld.css
2011-05-05 15:36:58 -07:00
John-Scott Atlakson
8e36358c04 Removed reference to handheld.css now that this has been removed. 2011-05-05 15:32:48 -07:00
Divya Manian
496898500c Merge pull request #483 from jsma/master
Removed dd_belatedpng.js from index.html
2011-05-05 15:32:28 -07:00
John-Scott Atlakson
fe1d2a3f70 Removed dd_belatedpng.js from index.html now that the file has been removed from the project. 2011-05-05 15:24:58 -07:00
necolas
dbed4dacf7 Remove handheld.css and belatedpng fix 2011-05-05 19:04:35 +01:00
necolas
fd2a816d53 Change form element alignments; group and reduce repetition of form element selectors 2011-05-05 18:33:28 +01:00
necolas
a7361c1a13 Remove font:inherit from reset. Fix #451 2011-05-05 18:01:41 +01:00
Divya Manian
3180b3f3dd Merge pull request #439 from clemos/master
trailing slash redirections should be relative
2011-05-04 21:05:16 -07:00
slavic
1a398b3eaf some more security for php - turn off error display and turn on error logging 2011-05-05 11:17:03 +08:00
slavic
61557bbe09 some more security for php 2011-05-05 11:13:33 +08:00
Divya Manian
1d229e42d1 Merge pull request #480 from walker/master
jQuery 1.6 update
2011-05-04 19:39:02 -07:00
Mathias Bynens
d96d5b6c8b Merge pull request #481 from jsma/patch-1
Added Site Speed tracking for Google Analytics.
2011-05-04 12:52:24 -07:00
John-Scott Atlakson
7bc7e96d96 Added Site Speed tracking for Google Analytics.
See => http://www.google.com/support/analyticshelp/bin/answer.py?hl=en&answer=1205784&topic=1120718
2011-05-04 12:51:19 -07:00
Paul Irish
edd1da8572 Merge pull request #478 from Calvein/master.
Moved the ::selection declaration
2011-05-04 12:08:32 -07:00
walker
ffa8bc9438 Updated links for 1.6 2011-05-04 12:17:23 -04:00
walker
c1e3a7e6b4 jQuery 1.6 2011-05-04 11:42:06 -04:00
François Robichet
6ce2a0f9f9 You might tweak the ::selection's color too. 2011-05-04 02:11:53 -07:00
necolas
ac92ae7a5f Update micro clearfix method 2011-04-26 22:59:45 +01:00
Paul Irish
37462b1bcc Merged pull request #469 from leobetosouza/patch-1.
Allow blackberry to read vcards
2011-04-26 12:34:06 -07:00
leobetosouza
fc7d9e1ebb Allow blackberry to read vcards 2011-04-26 12:25:51 -07:00
Mathias Bynens
b2faa1fc3c Add img { max-width: 100%; } to print styles to prevent images from getting cut off.
Hat tip: http://twitter.com/dontcallmedom/status/40413256942235648
2011-04-25 13:18:46 -07:00
necolas
1b78ceb957 Add overflow:hidden to pseudo-elements for clearfix. Avoids edge case of space at top of body in Firefox. 2011-04-21 19:57:53 +01:00
necolas
9a9660b2f9 Tidied up link to clearfix explanation 2011-04-21 17:09:22 +01:00
necolas
5373835d17 Update clearfix to use 'micro' clearfix 2011-04-21 11:32:49 +01:00
Matthew Donoughe
7e5efcc23c change jpeg task so it doesn't run unnecessarily
on my computer, unlike the old warning said, jpegtran was being run even
if the image had not changed
2011-04-16 18:49:47 +00:00
Matthew Donoughe
a2274d1993 copy files last
This slightly simplifies copying because we don't have to exclude png,
jpeg, or html files from the copy stage.
2011-04-16 18:43:57 +00:00
Matthew Donoughe
a59a243eda dd_belatedpng should be dd_belatedpng.min
it comes preminified, and we don't need to minify it again

This also updates the html so that the script is not missing if the
unminified scripts are unavailable on the server

This commit requires a change to existing html files :/
2011-04-16 18:38:39 +00:00
Shi Chuan
c0d3d939d7 Merge remote branch 'danielfilho/master' 2011-04-16 14:54:44 +08:00
Patrick Hall
b62ca34b72 curly quotes hates us 2011-04-14 16:48:55 -07:00
Daniel Filho
5b0dd0f4df fixing the order of stylesheets on build.xml as suggested by @shichuan. Fixes #435 2011-04-14 16:37:03 -03:00
Divya Manian
6ee79bc4ba making nicolas comment less wordy 2011-04-14 12:20:55 -07:00
necolas
72bb744064 Group link styles. Group form styles. Simplify the way input, button, textarea normalisation is done 2011-04-15 03:03:34 +08:00
necolas
0e18366fc5 Add input and button padding fixes for IE and Firefox 2011-04-15 03:03:33 +08:00
AD7six
45cd0378d5 don't add the callee - unless you're going to use it 2011-04-15 01:14:28 +08:00
walker
24b0f14ca0 Added in jquery 1.5.2 2011-04-15 00:55:44 +08:00
Daniel Filho
0843a608eb Put the -strip-console.log right befor all js.* calls on build.xml 2011-04-13 19:07:55 -03:00
Clément
1cf9f7487f removed slash to allow relative redirections 2011-04-12 12:23:07 +02:00
necolas
d2acfe0654 Simplify the conditional comment containing code for IE 9+ and modern browsers 2011-04-09 23:58:31 +08:00
Matthew Donoughe
eab37feb45 fix the recursive concatination properly
don't minify scripts-concat and libs-concat and there won't be a
scripts-concat.min.js to include into the next scripts-concat.js
2011-04-09 05:17:43 +00:00
Matthew Donoughe
f1a8fbf649 don't include scripts-concat in scripts-concat
otherwise your scripts duplicate and pile up
2011-04-08 21:51:20 +00:00
Matthew Donoughe
043491dea5 fix imgcopy 2011-04-08 18:30:24 +00:00
Matthew Donoughe
b817d1758c work around OptiPNG #2671422
delete old optimized pngs because optipng does not support overwriting
2011-04-08 18:29:19 +00:00
Matthew Donoughe
a0ac99a4d9 optimize build process
Intermediate stages are stored in a new intermediate folder, and only
files that should be published are copied into the publish folder.

Files are not deleted at the beginning of every build, and files that
have already been processed will not be reprocessed unless the source
has changed.

Versioned files are referenced by a SHA-1 hash of the content rather
than a build number. This means that changing your HTML and rebuilding
will not cause your users to redownload the same CSS and Javascript, and
a reverted change may cause users to use a copy that was previously
downloaded. It may be better to use only part of the hash so the HTTP
request is shorter.

Cleaning must be done manually to delete unreferenced files, or you will
eventually fill your publish folder with unreferenced files. AFAIK this
is a very hard problem to solve properly with Ant because there's no
file dependency tree available to show which files are not products of
the current build. It's doable by creating a map from source to publish
and excluding those files while deleting everything from publish, but it
may be better to just delete the publish directory?

console.log statements are no longer commented out. The regular
expression responsible did not work properly if there were parenthesis
inside the console.log, and it put comments into the scripts that had
just been minimized, so they weren't really minimal anymore.
2011-04-07 23:10:28 +00:00
Matthew Donoughe
96d7b26406 change the source htaccess rather than updating it 2011-04-07 23:10:28 +00:00
Matthew Donoughe
c35755b8d6 try not to reoptimize the same images every time 2011-04-07 23:09:48 +00:00
Paul Irish
e3007f0b31 nerf the serverconfig manip by checking to make sure it exists. fixes #423 2011-04-07 13:38:30 -07:00
Joe Morgan
2d4ddfeca9 Added JSHint as separate target and added ability to configure options in the project.properites file 2011-04-05 11:48:26 -04:00
Joe Morgan
164dcab88b Added JSHint target (separate from JSLint, so users could call either without having to make edits to the properties file) 2011-04-05 10:53:51 -04:00
Joe Morgan
5ea8b6446b Added JSLint target to build script (runs independently on source JS, excludes *.min.js and libs/*.js files) 2011-04-05 09:15:48 -04:00
Joe Morgan
ce6878eeb4 added comment 2011-04-05 09:11:33 -04:00
Joe Morgan
7ef42605c2 added some globals for rhino functions 2011-04-05 09:09:18 -04:00
Joe Morgan
b736756a92 prettied up the JSLint code 2011-04-05 09:06:51 -04:00
Joe Morgan
3820568da4 added config options to jslint 2011-04-04 21:50:14 -04:00
Joe Morgan
ce7e249ae4 added jslint target 2011-04-04 21:40:49 -04:00
Paul Irish
8185bc313a Update htmlcompressor to 1.1 which uses the new yuicompressor for CSS. fixing a @media query bug (for inline style tags.) 2011-03-30 12:51:52 -07:00
Paul Irish
bb22ca66a8 Remove the cache-busting query parameters from the HTML. Details below:
In case you were wondering what ?v=2 was for.. read this:
http://html5boilerplate.com/docs/#Version-Control-with-Cachebusting

Query param revving is bad news:
http://www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/

Even though that warning is from 2008, I've confirmed with Souders (a few months ago)
that this is still a concern.

The build script automatically revs filenames for you, so this is taken care of.
If you need to manually cachebust, then feel free to add the query params yourself, but
be aware of the small consequences. It shouldn't be a regular thing. ;)
2011-03-30 08:26:45 -07:00
Mike Almond
5b6db9d0bd Disable directory browsing by default 2011-03-29 12:01:22 -07:00
Han Lin Yap
edf9c3fbdb httponly 2011-03-29 22:53:34 +08:00
Gregg Gajic
9b1a477b12 Fix typo in Changelog 2011-03-28 17:55:11 -05:00
Paul Irish
41c657a05a adjust attribution byline. 2011-03-26 16:54:40 -07:00
Samus_
b9341fe4ce protecting against git rev-parse silly behavior on unrecognized options 2011-03-25 23:25:50 -04:00
Samus_
91fa216839 protect commands from weird filenames 2011-03-25 22:55:25 -04:00
Paul Irish
e4edeff4fa Revert "Fixing input type="search" behaviour in Safari by John Lein http://diveintohtml5.org/forms.html thanks to MarcHaunschild and hoopyfrood fixes #396"
This reverts commit 4dc87b52c2.

Based on the conversation here:
https://github.com/paulirish/html5-boilerplate/commit/4dc87b52c2
2011-03-23 13:30:34 -07:00
Shi Chuan
4dc87b52c2 Fixing input type="search" behaviour in Safari by John Lein http://diveintohtml5.org/forms.html thanks to MarcHaunschild and hoopyfrood fixes #396 2011-03-24 00:33:24 +08:00
Shi Chuan
71880dee16 fixed missing letter t in properties files in build tool 2011-03-23 00:49:08 +08:00
Shi Chuan
5c9fa3a83d fixed typo styleshee to stylesheet in build default properties 2011-03-23 00:32:14 +08:00
alrra
19fec34e0d modified the 404 page (it can cause some problems in IE if the user decided to use the html5shiv: e.g.: http://i.imgur.com/iK5ad.png) 2011-03-22 21:49:55 +08:00
Paul Irish
50fb1a7870 update yuicompressor to 2.4.5. fixes media query minification issue.
Basically ...

@media screen and (max-width:980px){

was getting minified to

@media screen and(max-width:980px){

Which webkit was rejecting.. So.. now the updated yuicompressor leaves that space in place.
And all is well with the world.
<3z
2011-03-21 23:19:13 -07:00
Paul Irish
69039d03b9 build script: spruced up the echo messages to make it a little friendlier. 2011-03-20 18:47:13 -07:00
Paul Irish
2fedc604cc createproject shoudl also copy build and test folders. 2011-03-20 16:24:36 -07:00
Dmitry Gladkov
aa3068c8e0 fix createproject.sh directory copying 2011-03-20 15:54:37 -07:00
Paul Irish
7f73ae3d72 build script: go back to yuicompressor for CSS. php dependency is a little awkward. temporary goodbye to css @import inlining. :/ au revoir. 2011-03-20 10:23:53 -07:00
Paul Irish
94cb8195b7 build script: change search/replace to be a global task. 2011-03-20 10:20:27 -07:00
Divya Manian
5b4ddd3a58 updated read me with translators, contributors 2011-03-19 21:34:34 -07:00
Paul Irish
dc5379c0c9 delete build.properties. consider it vestigal. 2011-03-19 15:01:37 -07:00
Paul Irish
828141a41d build script: adjust images path in case folder structure is unique. 2011-03-19 15:01:36 -07:00
David Murdoch
d7d467e69e Replace single-quotes with double-quotes for consistency and to save a few extra bytes during GZIP/DEFLATE compression 2011-03-16 05:50:07 +08:00
jbueza
ff3ed8f402 Fixed demo elements page with whitespace fix. 2011-03-16 05:47:10 +08:00
Marcel Turi
caeb9138fc Description corrections for "Built-in filename-based cache busting" section. 2011-03-16 00:49:03 +08:00
Shi Chuan
17894ff685 added separate task prodcopy to handle buildkit and build with jpgtran 2011-03-08 01:23:23 +08:00
Paul Irish
a39f656d95 Revert " removing demo/ and readme temporarily to tag."
That was just temporary so i could tag the release.

This reverts commit f93c3a5b87.
2011-03-07 00:38:05 -08:00
136 changed files with 6493 additions and 16532 deletions

22
.editorconfig Normal file
View File

@@ -0,0 +1,22 @@
# For more information about the properties used in
# this file, please see the EditorConfig documentation:
# http://editorconfig.org/
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
[{.travis.yml,package.json}]
# The indent size used in the `package.json` file cannot be changed
# https://github.com/npm/npm/pull/3180#issuecomment-16336516
indent_size = 2
indent_style = space

21
.gitattributes vendored Normal file
View File

@@ -0,0 +1,21 @@
# Automatically normalize line endings for all text-based files
# http://git-scm.com/docs/gitattributes#_end_of_line_conversion
* text=auto
# For the following file types, normalize line endings to LF on
# checkin and prevent conversion to CRLF when they are checked out
# (this is required in order to prevent newline related issues like,
# for example, after the build script is run)
.* text eol=lf
*.css text eol=lf
*.html text eol=lf
*.js text eol=lf
*.json text eol=lf
*.md text eol=lf
*.sh text eol=lf
*.txt text eol=lf
*.xml text eol=lf
# Exclude the `.htaccess` file from GitHub's language statistics
# https://github.com/github/linguist#using-gitattributes
dist/.htaccess linguist-vendored

38
.gitignore vendored
View File

@@ -1,36 +1,2 @@
# Numerous always-ignore extensions
*.diff
*.err
*.orig
*.log
*.rej
*.swo
*.swp
*.vi
*~
# OS or Editor folders
.DS_Store
.cache
.project
.settings
nbproject
thumbs.db
# Dreamweaver added files
_notes
dwsync.xml
# Komodo
*.komodoproject
.komodotools
# Folders to ignore
.hg
.svn
publish
.idea
# build script local files
build/buildinfo.properties
build/config/buildinfo.properties
archive
node_modules

475
.htaccess
View File

@@ -1,475 +0,0 @@
# Apache configuration file
# httpd.apache.org/docs/2.2/mod/quickreference.html
# Note .htaccess files are an overhead, this logic should be in your Apache config if possible
# httpd.apache.org/docs/2.2/howto/htaccess.html
# Techniques in here adapted from all over, including:
# Kroc Camen: camendesign.com/.htaccess
# perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/
# Sample .htaccess file of CMS MODx: modxcms.com
###
### If you run a webserver other than apache, consider:
### github.com/paulirish/html5-boilerplate-server-configs
###
# ----------------------------------------------------------------------
# Better website experience for IE users
# ----------------------------------------------------------------------
# Force the latest IE version, in various cases when it may fall back to IE7 mode
# github.com/rails/rails/commit/123eb25#commitcomment-118920
# Use ChromeFrame if it's installed for a better experience for the poor IE folk
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
BrowserMatch MSIE ie
Header set X-UA-Compatible "IE=Edge,chrome=1" env=ie
</IfModule>
</IfModule>
<IfModule mod_headers.c>
# Because X-UA-Compatible isn't sent to non-IE (to save header bytes),
# We need to inform proxies that content changes based on UA
Header append Vary User-Agent
# Cache control is set only if mod_headers is enabled, so that's unncessary to declare
</IfModule>
# ----------------------------------------------------------------------
# Cross-domain AJAX requests
# ----------------------------------------------------------------------
# Serve cross-domain ajax requests, disabled.
# enable-cors.org
# code.google.com/p/html5security/wiki/CrossOriginRequestSecurity
# <IfModule mod_headers.c>
# Header set Access-Control-Allow-Origin "*"
# </IfModule>
# ----------------------------------------------------------------------
# Webfont access
# ----------------------------------------------------------------------
# allow access from all domains for webfonts
# alternatively you could only whitelist
# your subdomains like "sub.domain.com"
<FilesMatch "\.(ttf|otf|eot|woff|font.css)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>
# ----------------------------------------------------------------------
# Proper MIME type for all files
# ----------------------------------------------------------------------
# audio
AddType audio/ogg oga ogg
# video
AddType video/ogg ogv
AddType video/mp4 mp4
AddType video/webm webm
# Proper svg serving. Required for svg webfonts on iPad
# twitter.com/FontSquirrel/status/14855840545
AddType image/svg+xml svg svgz
AddEncoding gzip svgz
# webfonts
AddType application/vnd.ms-fontobject eot
AddType font/truetype ttf
AddType font/opentype otf
AddType application/x-font-woff woff
# assorted types
AddType image/x-icon ico
AddType image/webp webp
AddType text/cache-manifest appcache manifest
AddType text/x-component htc
AddType application/x-chrome-extension crx
AddType application/x-xpinstall xpi
AddType application/octet-stream safariextz
# ----------------------------------------------------------------------
# Allow concatenation from within specific js and css files
# ----------------------------------------------------------------------
# e.g. Inside of script.combined.js you could have
# <!--#include file="libs/jquery-1.5.0.min.js" -->
# <!--#include file="plugins/jquery.idletimer.js" -->
# and they would be included into this single file
# this is not in use in the boilerplate as it stands. you may
# choose to name your files in this way for this advantage
# or concatenate and minify them manually.
# Disabled by default.
# <FilesMatch "\.combined\.(js|css)$">
# Options +Includes
# SetOutputFilter INCLUDES
# </FilesMatch>
# ----------------------------------------------------------------------
# gzip compression
# ----------------------------------------------------------------------
<IfModule mod_deflate.c>
# force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s,?\s(gzip|deflate)?|X{4,13}|~{4,13}|-{4,13})$ HAVE_Accept-Encoding
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
</IfModule>
</IfModule>
# html, txt, css, js, json, xml, htc:
<IfModule filter_module>
FilterDeclare COMPRESS
FilterProvider COMPRESS DEFLATE resp=Content-Type /text/(html|css|javascript|plain|x(ml|-component))/
FilterProvider COMPRESS DEFLATE resp=Content-Type /application/(javascript|json|xml|x-javascript)/
FilterChain COMPRESS
FilterProtocol COMPRESS change=yes;byteranges=no
</IfModule>
<IfModule !mod_filter.c>
# Legacy versions of Apache
AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript
AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
</IfModule>
# webfonts and svg:
<FilesMatch "\.(ttf|otf|eot|svg)$" >
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>
# ----------------------------------------------------------------------
# Expires headers (for better cache control)
# ----------------------------------------------------------------------
# these are pretty far-future expires headers
# they assume you control versioning with cachebusting query params like
# <script src="application.js?20100608">
# additionally, consider that outdated proxies may miscache
# www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/
# if you don't use filenames to version, lower the css and js to something like
# "access plus 1 week" or so
<IfModule mod_expires.c>
ExpiresActive on
# Perhaps better to whitelist expires rules? Perhaps.
ExpiresDefault "access plus 1 month"
# cache.appcache needs re-requests in FF 3.6 (thx Remy ~Introducing HTML5)
ExpiresByType text/cache-manifest "access plus 0 seconds"
# your document html
ExpiresByType text/html "access plus 0 seconds"
# data
ExpiresByType text/xml "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType application/json "access plus 0 seconds"
# rss feed
ExpiresByType application/rss+xml "access plus 1 hour"
# favicon (cannot be renamed)
ExpiresByType image/x-icon "access plus 1 week"
# media: images, video, audio
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType video/ogg "access plus 1 month"
ExpiresByType audio/ogg "access plus 1 month"
ExpiresByType video/mp4 "access plus 1 month"
ExpiresByType video/webm "access plus 1 month"
# htc files (css3pie)
ExpiresByType text/x-component "access plus 1 month"
# webfonts
ExpiresByType font/truetype "access plus 1 month"
ExpiresByType font/opentype "access plus 1 month"
ExpiresByType application/x-font-woff "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
# css and javascript
ExpiresByType text/css "access plus 2 months"
ExpiresByType application/javascript "access plus 2 months"
ExpiresByType text/javascript "access plus 2 months"
<IfModule mod_headers.c>
Header append Cache-Control "public"
</IfModule>
</IfModule>
# ----------------------------------------------------------------------
# ETag removal
# ----------------------------------------------------------------------
# Since we're sending far-future expires, we don't need ETags for
# static content.
# developer.yahoo.com/performance/rules.html#etags
FileETag None
# ----------------------------------------------------------------------
# Stop screen flicker in IE on CSS rollovers
# ----------------------------------------------------------------------
# The following directives stop screen flicker in IE on CSS rollovers - in
# combination with the "ExpiresByType" rules for images (see above). If
# needed, un-comment the following rules.
# BrowserMatch "MSIE" brokenvary=1
# BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1
# BrowserMatch "Opera" !brokenvary
# SetEnvIf brokenvary 1 force-no-vary
# ----------------------------------------------------------------------
# Cookie setting from iframes
# ----------------------------------------------------------------------
# Allow cookies to be set from iframes (for IE only)
# If needed, uncomment and specify a path or regex in the Location directive
# <IfModule mod_headers.c>
# <Location />
# Header set P3P "policyref=\"/w3c/p3p.xml\", CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\""
# </Location>
# </IfModule>
# ----------------------------------------------------------------------
# Start rewrite engine
# ----------------------------------------------------------------------
# Turning on the rewrite engine is necessary for the following rules and features.
<IfModule mod_rewrite.c>
RewriteEngine On
</IfModule>
# ----------------------------------------------------------------------
# Suppress or force the "www." at the beginning of URLs
# ----------------------------------------------------------------------
# The same content should never be available under two different URLs - especially not with and
# without "www." at the beginning, since this can cause SEO problems (duplicate content).
# That's why you should choose one of the alternatives and redirect the other one.
# By default option 1 (no "www.") is activated. Remember: Shorter URLs are sexier.
# no-www.org/faq.php?q=class_b
# If you rather want to use option 2, just comment out all option 1 lines
# and uncomment option 2.
# IMPORTANT: NEVER USE BOTH RULES AT THE SAME TIME!
# ----------------------------------------------------------------------
# Option 1:
# Rewrite "www.domain.com -> domain.com"
<IfModule mod_rewrite.c>
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
</IfModule>
# ----------------------------------------------------------------------
# Option 2:
# To rewrite "domain.com -> www.domain.com" uncomment the following lines.
# Be aware that the following rule might not be a good idea if you
# use "real" subdomains for certain parts of your website.
# <IfModule mod_rewrite.c>
# RewriteCond %{HTTPS} !=on
# RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
# RewriteCond %{HTTP_HOST} (.+)$ [NC]
# RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]
# </IfModule>
# ----------------------------------------------------------------------
# Add/remove trailing slash to (non-file) URLs
# ----------------------------------------------------------------------
# Google treats URLs with and without trailing slashes separately.
# Forcing a trailing slash is usually preferred, but all that's really
# important is that one correctly redirects to the other.
# By default option 1 (force trailing slash) is activated.
# http://googlewebmastercentral.blogspot.com/2010/04/to-slash-or-not-to-slash.html
# http://www.alistapart.com/articles/slashforward/
# http://httpd.apache.org/docs/2.0/misc/rewriteguide.html#url Trailing Slash Problem
# ----------------------------------------------------------------------
# Option 1:
# Rewrite "domain.com/foo -> domain.com/foo/"
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/|#(.*))$
RewriteRule ^(.*)$ /$1/ [R=301,L]
</IfModule>
# ----------------------------------------------------------------------
# Option 2:
# Rewrite "domain.com/foo/ -> domain.com/foo"
#<IfModule mod_rewrite.c>
# RewriteRule ^(.*)/$ /$1 [R=301,L]
#</IfModule>
# ----------------------------------------------------------------------
# Built-in filename-based cache busting
# ----------------------------------------------------------------------
# If you're not using the build script to manage your filename version revving,
# you might want to consider enabling this, which will route requests for
# /css/all.20110203.css to /res/all.css
# To understand why this is important and a better idea than all.css?v1231,
# read: github.com/paulirish/html5-boilerplate/wiki/Version-Control-with-Cachebusting
# Uncomment to enable.
# <IfModule mod_rewrite.c>
# RewriteCond %{REQUEST_FILENAME} !-f
# RewriteCond %{REQUEST_FILENAME} !-d
# RewriteRule ^(.+)\.(\d+)\.(js|css|png|jpg|gif)$ $1.$3 [L]
# </IfModule>
# ----------------------------------------------------------------------
# Prevent SSL cert warnings
# ----------------------------------------------------------------------
# Rewrite secure requests properly to prevent SSL cert warnings, e.g. prevent
# https://www.domain.com when your cert only allows https://secure.domain.com
# Uncomment the following lines to use this feature.
# <IfModule mod_rewrite.c>
# RewriteCond %{SERVER_PORT} !^443
# RewriteRule (.*) https://example-domain-please-change-me.com/$1 [R=301,L]
# </IfModule>
# ----------------------------------------------------------------------
# Prevent 404 errors for non-existing redirected folders
# ----------------------------------------------------------------------
# without -MultiViews, Apache will give a 404 for a rewrite if a folder of the same name does not exist
# e.g. /blog/hello : webmasterworld.com/apache/3808792.htm
Options -MultiViews
# ----------------------------------------------------------------------
# custom 404 page
# ----------------------------------------------------------------------
# You can add custom pages to handle 500 or 403 pretty easily, if you like.
ErrorDocument 404 /404.html
# ----------------------------------------------------------------------
# UTF-8 encoding
# ----------------------------------------------------------------------
# use utf-8 encoding for anything served text/plain or text/html
AddDefaultCharset utf-8
# force utf-8 for a number of file formats
AddCharset utf-8 .html .css .js .xml .json .rss
# ----------------------------------------------------------------------
# A little more security
# ----------------------------------------------------------------------
# Do we want to advertise the exact version number of Apache we're running?
# Probably not.
## This can only be enabled if used in httpd.conf - It will not work in .htaccess
# ServerTokens Prod
# "-Indexes" will have Apache block users from browsing folders without a default document
# Usually you should leave this activated, because you shouldn't allow everybody to surf through
# every folder on your server (which includes rather private places like CMS system folders).
# Options -Indexes
# Block access to "hidden" directories whose names begin with a period. This
# includes directories used by version control systems such as Subversion or Git.
<IfModule mod_rewrite.c>
RewriteRule "(^|/)\." - [F]
</IfModule>
# If your server is not already configured as such, the following directive
# should be uncommented in order to set PHP's register_globals option to OFF.
# This closes a major security hole that is abused by most XSS (cross-site
# scripting) attacks. For more information: http://php.net/register_globals
#
# IF REGISTER_GLOBALS DIRECTIVE CAUSES 500 INTERNAL SERVER ERRORS :
#
# Your server does not allow PHP directives to be set via .htaccess. In that
# case you must make this change in your php.ini file instead. If you are
# using a commercial web host, contact the administrators for assistance in
# doing this. Not all servers allow local php.ini files, and they should
# include all PHP configurations (not just this one), or you will effectively
# reset everything to PHP defaults. Consult www.php.net for more detailed
# information about setting PHP directives.
# php_flag register_globals Off

68
.jscsrc Normal file
View File

@@ -0,0 +1,68 @@
{
"disallowEmptyBlocks": true,
"disallowKeywords": [
"with"
],
"disallowMixedSpacesAndTabs": true,
"disallowMultipleLineStrings": true,
"disallowMultipleVarDecl": true,
"disallowSpaceAfterPrefixUnaryOperators": [
"!",
"+",
"++",
"-",
"--",
"~"
],
"disallowSpaceBeforeBinaryOperators": [
","
],
"disallowSpaceBeforePostfixUnaryOperators": true,
"disallowSpacesInNamedFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInsideArrayBrackets": true,
"disallowSpacesInsideParentheses": true,
"disallowTrailingComma": true,
"disallowTrailingWhitespace": true,
"requireCamelCaseOrUpperCaseIdentifiers": true,
"requireCapitalizedConstructors": true,
"requireCommaBeforeLineBreak": true,
"requireCurlyBraces": true,
"requireDotNotation": true,
"requireLineFeedAtFileEnd": true,
"requireParenthesesAroundIIFE": true,
"requireSpaceAfterBinaryOperators": true,
"requireSpaceAfterKeywords": [
"catch",
"do",
"else",
"for",
"if",
"return",
"switch",
"try",
"while"
],
"requireSpaceAfterLineComment": true,
"requireSpaceBeforeBinaryOperators": true,
"requireSpaceBeforeBlockStatements": true,
"requireSpacesInAnonymousFunctionExpression": {
"beforeOpeningCurlyBrace": true
},
"requireSpacesInConditionalExpression": true,
"requireSpacesInFunctionDeclaration": {
"beforeOpeningCurlyBrace": true
},
"requireSpacesInFunctionExpression": {
"beforeOpeningCurlyBrace": true
},
"requireSpacesInNamedFunctionExpression": {
"beforeOpeningCurlyBrace": true
},
"requireSpacesInsideObjectBrackets": "allButNested",
"validateIndentation": 4,
"validateLineBreaks": "LF",
"validateParameterSeparator": ", ",
"validateQuoteMarks": "'"
}

32
.jshintrc Normal file
View File

@@ -0,0 +1,32 @@
{
// Enforcing options
// http://www.jshint.com/docs/options/#enforcing-options
"bitwise": true,
"eqeqeq": true,
"forin": true,
"latedef": true,
"noarg": true,
"nonbsp": true,
"nonew": true,
"undef": true,
"unused": true,
// - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Relaxing options
// http://www.jshint.com/docs/options/#relaxing-options
"esnext": true,
// - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Environments
// http://www.jshint.com/docs/options/#environments
"browser": true,
"jquery": true,
"node": true
}

82
.travis.yml Normal file
View File

@@ -0,0 +1,82 @@
# For more information about the configurations used
# in this file, please see the Travis CI documentation:
# http://docs.travis-ci.com
after_success:
# Temporary workaround for:
# https://github.com/travis-ci/travis-ci/issues/929
- python travis_after_all.py
- export $(cat .to_export_back) &> /dev/null
- |
# If all the tests pass in all the runtimes, make Travis
# automatically download and execute the following script
if [ "$BUILD_LEADER" == "YES" ]; then
if [ "$BUILD_AGGREGATE_STATUS" == "others_succeeded" ]; then \
# Clean up helper files
rm -rf travis_after_all.py .to_export_back && \
# The `commit_build_changes.sh` script will run the build,
# and if that generates changes, it will commit them to the
# `master` branch:
#
# * ensuring that the content from the `dist/` directory
# is always in sync with the rest of the content
#
# * removing the need to execute the build step locally
# everytime a change is made (especially in the case
# of trivial changes such as typos)
#
# Note: The `commit_build_changes.sh` script will only run
# if the commit was made to the `master` branch.
curl -sSL "https://raw.githubusercontent.com/h5bp-bot/scripts/0.6.1/commit_build_changes.sh" |
bash -s -- --branch "master" \
--commands "npm install && npm run build" \
--commit-message "Update content from the \`dist\` directory [skip ci]";
fi
fi
env:
global:
# The `secure` key contains three encrypted environment variables
# (GH_TOKEN, GH_USER_EMAIL and GH_USER_NAME), the values of which
# are used by the scripts that are automatically executed by Travis.
#
# Note: The `secure` key will only work for this repository, so if
# you create your own fork, you will need to generate your own key:
#
# travis encrypt -r "<username>/<repository>" \
# GH_TOKEN="<your_github_access_token>" \
# GH_USER_EMAIL="<your_email>" \
# GH_USER_NAME="<your_name>"
#
# To learn more about how to generate the:
#
# * `secure` key, see:
# http://docs.travis-ci.com/user/encryption-keys/
#
# * GitHub access token, see:
# https://help.github.com/articles/creating-an-access-token-for-command-line-use/
- secure: "OQnRHkXKdvSujTPm0DSXJFrso0zKltkso0e8zF/2GLI7ouv60ELHhYCrWFuoeefSJFbiPeH/9GXnTAv7y+gC08Ba/DSlXGaHl4db5xU/7AazzQR4YaTks6z0CfvlftdlimGOY27tuDU8hMfqHJKybJGcEvFKCVJms/7udYYh+CA="
git:
depth: 10
language: node_js
node_js:
- "iojs"
- "0.12"
script:
- curl -sSLo travis_after_all.py https://raw.github.com/dmakhno/travis_after_all/master/travis_after_all.py
sudo: false

View File

@@ -1,32 +0,0 @@
<!doctype html>
<title>Page Not Found</title>
<style>
body { text-align: center;}
h1 { font-size: 50px; text-align: center }
span[frown] { transform: rotate(90deg); display:inline-block; color: #bbb; }
body { font: 20px Constantia, 'Hoefler Text', "Adobe Caslon Pro", Baskerville, Georgia, Times, serif; color: #999; text-shadow: 2px 2px 2px rgba(200, 200, 200, 0.5); }
::-moz-selection{ background:#FF5E99; color:#fff; }
::selection { background:#FF5E99; color:#fff; }
article {display:block; text-align: left; width: 500px; margin: 0 auto; }
a { color: rgb(36, 109, 56); text-decoration:none; }
a:hover { color: rgb(96, 73, 141) ; text-shadow: 2px 2px 2px rgba(36, 109, 56, 0.5); }
</style>
<article>
<h1>Not found <span frown>:(</span></h1>
<div>
<p>Sorry, but the page you were trying to view does not exist.</p>
<p>It looks like this was the result of either:</p>
<ul>
<li>a mistyped address</li>
<li>an out-of-date link</li>
</ul>
</div>
<script>
var GOOG_FIXURL_LANG = (navigator.language || '').slice(0,2),
GOOG_FIXURL_SITE = location.host;
</script>
<script src="http://linkhelp.clients.google.com/tbproxy/lh/wm/fixurl.js"></script>
</article>

254
CHANGELOG.md Normal file
View File

@@ -0,0 +1,254 @@
### 5.2.0 (May 1, 2015)
* Update jQuery to `v1.11.3`
([#1699](https://github.com/h5bp/html5-boilerplate/issues/1699)).
* Deprecate protocol-relative URLs
([#1694](https://github.com/h5bp/html5-boilerplate/issues/1694)).
* Update high resolution media query
([#1474](https://github.com/h5bp/html5-boilerplate/issues/1474)).
* Update Apache Server Configs to `v2.14.0`.
### 5.1.0 (April 1, 2015)
* Update Normalize.css to `v3.0.3`.
* Use `https://` in the Google Universal Analytics snippet
([eee759b](https://github.com/h5bp/html5-boilerplate/commit/eee759bfe175e850bbc8e4ad0682ec4fe4bd05d6)).
* Remove the `visibility: hidden` declaration from `.hidden`
([#1663](https://github.com/h5bp/html5-boilerplate/issues/1663)).
* Use `<meta http-equiv="x-ua-compatible" content="ie=edge">`<br>
instead of `<meta http-equiv="X-UA-Compatible" content="IE=edge">`
([#1656](https://github.com/h5bp/html5-boilerplate/issues/1656)).
* Update Apache Server Configs to `v2.13.0`.
### 5.0.0 (February 1, 2015)
* Update to jQuery 1.11.2.
* Update Apache Server Configs to v2.11.0.
* Rename Apple touch icon to `apple-touch-icon.png` and add
`<link>` in `index.html`
([#1622](https://github.com/h5bp/html5-boilerplate/issues/1622)).
* Add vertical centering for `iframe`
([#1613](https://github.com/h5bp/html5-boilerplate/issues/1613)).
* Change the outdated browser prompt classname to `browserupgrade`
([#1608](https://github.com/h5bp/html5-boilerplate/issues/1608)).
* Update to Normalize.css 3.0.2.
([#1050](https://github.com/h5bp/html5-boilerplate/issues/1050)).
* Update `apple-touch-icon-precomposed.png` and the _"Apple touch
icons"_ related documentation
([#1599](https://github.com/h5bp/html5-boilerplate/pull/1599)).
* Add pseudo-elements to universal selector in print media query
([#1585](https://github.com/h5bp/html5-boilerplate/pull/1585)).
* Update to Modernizr 2.8.3.
* Remove need to readjust margins in `404.html`
([#1567](https://github.com/h5bp/html5-boilerplate/pull/1567)).
* Add `/.editorconfig` file
([#1561](https://github.com/h5bp/html5-boilerplate/issues/1561),
[#1564](https://github.com/h5bp/html5-boilerplate/issues/1564)).
* Add `auto` to the Google Universal Analytics tracker create method
([#1562](https://github.com/h5bp/html5-boilerplate/issues/1562)).
* Add `timeline` and `timelineEnd` to the list of `console` methods
([#1559](https://github.com/h5bp/html5-boilerplate/issues/1559)).
* Add `lang=""` to `<html>`
([#1542](https://github.com/h5bp/html5-boilerplate/issues/1542)).
* Use `<!doctype html>` instead of `<!DOCTYPE html>`
([#1522](https://github.com/h5bp/html5-boilerplate/issues/1522)).
* Add `/browserconfig.xml` file and tile images
([#1481](https://github.com/h5bp/html5-boilerplate/issues/1481)).
* Add `Disallow:` to `robots.txt`
([#1487](https://github.com/h5bp/html5-boilerplate/issues/1487)).
* Remove default foreground color from form elements
([#1390](https://github.com/h5bp/html5-boilerplate/issues/1390)).
* Remove default margin from print styles
([#1477](https://github.com/h5bp/html5-boilerplate/issues/1477)).
* Remove image replacement helper class `.ir`
([#1472](https://github.com/h5bp/html5-boilerplate/issues/1472),
[#1475](https://github.com/h5bp/html5-boilerplate/issues/1475)).
* Add vertical centering for `svg`
([#1453](https://github.com/h5bp/html5-boilerplate/issues/1453)).
* Redesign 404 page
([#1443](https://github.com/h5bp/html5-boilerplate/pull/1443)).
* Remove IE 6/7 hacks from `main.css`
([#1050](https://github.com/h5bp/html5-boilerplate/issues/1050)).
* Remove IE conditional classes
([#1187](https://github.com/h5bp/html5-boilerplate/issues/1187),
[#1290](https://github.com/h5bp/html5-boilerplate/issues/1290)).
### 4.3.0 (September 10, 2013)
* Use one `apple-touch-icon` instead of six
([#1367](https://github.com/h5bp/html5-boilerplate/issues/1367)).
* Move font-related declarations from `body` to `html`
([#1411](https://github.com/h5bp/html5-boilerplate/issues/1411)).
* Update to Apache Server Configs 1.1.0.
* Add `initial-scale=1` to the viewport `meta`
([#1398](https://github.com/h5bp/html5-boilerplate/pull/1398)).
* Vertical centering for audio-, canvas- and video-tags
([#1326](https://github.com/h5bp/html5-boilerplate/issues/1326)).
* Remove Google Chrome Frame related code
([#1379](https://github.com/h5bp/html5-boilerplate/pull/1379),
[#1396](https://github.com/h5bp/html5-boilerplate/pull/1396)).
* Update to Google Universal Analytics
([#1347](https://github.com/h5bp/html5-boilerplate/issues/1347)).
* Update to jQuery 1.10.2.
* Update to Normalize.css 1.1.3.
### 4.2.0 (April 8, 2013)
* Remove Google Analytics protocol check
([#1319](https://github.com/h5bp/html5-boilerplate/pull/1319)).
* Update to Normalize.css 1.1.1.
* Update Apache configurations to include the latest changes in the
canonical [`.htaccess`](https://github.com/h5bp/server-configs-apache)
file.
* Use a protocol relative URL for the 404 template script.
* Update to jQuery 1.9.1.
### 4.1.0 (January 21, 2013)
* Update to Normalize.css 1.1.0.
* Update to jQuery 1.9.0.
### 4.0.3 (January 12, 2013)
* Use 32x32 favicon.ico
([#1286](https://github.com/h5bp/html5-boilerplate/pull/1286)).
* Remove named function expression in plugins.js
([#1280](https://github.com/h5bp/html5-boilerplate/pull/1280)).
* Adjust CSS image-replacement code
([#1239](https://github.com/h5bp/html5-boilerplate/issues/1239)).
* Update HiDPI example media query
([#1127](https://github.com/h5bp/html5-boilerplate/issues/1127)).
### 4.0.2 (December 9, 2012)
* Update placeholder icons.
* Update to Normalize.css 1.0.2.
* Update to jQuery 1.8.3.
### 4.0.1 (October 20, 2012)
* Further improvements to `console` method stubbing
([#1206](https://github.com/h5bp/html5-boilerplate/issues/1206),
[#1229](https://github.com/h5bp/html5-boilerplate/pull/1229)).
* Update to jQuery 1.8.2.
* Update to Modernizr 2.6.2.
* Minor additions to the documentation.
### 4.0.0 (August 28, 2012)
* Improve the Apache compression configuration
([#1012](https://github.com/h5bp/html5-boilerplate/issues/1012),
[#1173](https://github.com/h5bp/html5-boilerplate/issues/1173)).
* Add a HiDPI example media query
([#1127](https://github.com/h5bp/html5-boilerplate/issues/1127)).
* Add bundled docs
([#1154](https://github.com/h5bp/html5-boilerplate/issues/1154)).
* Add MIT license
([#1139](https://github.com/h5bp/html5-boilerplate/issues/1139)).
* Update to Normalize.css 1.0.1.
* Separate Normalize.css from the rest of the CSS
([#1160](https://github.com/h5bp/html5-boilerplate/issues/1160)).
* Improve `console.log` protection
([#1107](https://github.com/h5bp/html5-boilerplate/issues/1107)).
* Replace hot pink text selection color with a neutral color.
* Change image replacement technique
([#1149](https://github.com/h5bp/html5-boilerplate/issues/1149)).
* Code format and consistency changes
([#1112](https://github.com/h5bp/html5-boilerplate/issues/1112)).
* Rename CSS file and rename JS files and subdirectories.
* Update to jQuery 1.8
([#1161](https://github.com/h5bp/html5-boilerplate/issues/1161)).
* Update to Modernizr 2.6.1
([#1086](https://github.com/h5bp/html5-boilerplate/issues/1086)).
* Remove uncompressed jQuery
([#1153](https://github.com/h5bp/html5-boilerplate/issues/1153)).
* Remove superfluous inline comments
([#1150](https://github.com/h5bp/html5-boilerplate/issues/1150)).
### 3.0.2 (February 19, 2012)
* Update to Modernizr 2.5.3.
### 3.0.1 (February 08, 2012).
* Update to Modernizr 2.5.2 (includes html5shiv 3.3).
### 3.0.0 (February 06, 2012)
* Improvements to `.htaccess`.
* Improve 404 design.
* Simplify JS folder structure.
* Change `html` IE class names changed to target ranges rather than
specific versions of IE.
* Update CSS to include latest normalize.css changes and better
typographic defaults
([#825](https://github.com/h5bp/html5-boilerplate/issues/825)).
* Update to Modernizr 2.5 (includes yepnope 1.5 and html5shiv 3.2).
* Update to jQuery 1.7.1.
* Revert to async snippet for the Google Analytics script.
* Remove the ant build script
([#826](https://github.com/h5bp/html5-boilerplate/issues/826)).
* Remove Respond.js
([#816](https://github.com/h5bp/html5-boilerplate/issues/816)).
* Remove the `demo/` directory
([#808](https://github.com/h5bp/html5-boilerplate/issues/808)).
* Remove the `test/` directory
([#808](https://github.com/h5bp/html5-boilerplate/issues/808)).
* Remove Google Chrome Frame script for IE6 users; replace with links
to Chrome Frame and options for alternative browsers.
* Remove `initial-scale=1` from the viewport `meta`
([#824](https://github.com/h5bp/html5-boilerplate/issues/824)).
* Remove `defer` from all scripts to avoid legacy IE bugs.
* Remove explicit Site Speed tracking for Google Analytics. It's now
enabled by default.
### 2.0.0 (August 10, 2011)
* Change starting CSS to be based on normalize.css instead of reset.css
([#500](https://github.com/h5bp/html5-boilerplate/issues/500)).
* Add Respond.js media query polyfill.
* Add Google Chrome Frame script prompt for IE6 users.
* Simplify the `html` conditional comments for modern browsers and add
an `oldie` class.
* Update clearfix to use "micro clearfix".
* Add placeholder CSS MQs for mobile-first approach.
* Add `textarea { resize: vertical; }` to only allow vertical resizing.
* Add `img { max-width: 100%; }` to the print styles; prevents images
being truncated.
* Add Site Speed tracking for Google Analytics.
* Update to jQuery 1.6.2 (and use minified by default).
* Update to Modernizr 2.0 Complete, Production minified (includes
yepnope, html5shiv, and Respond.js).
* Use `Modernizr.load()` to load the Google Analytics script.
* Much faster build process.
* Add build script options for CSSLint, JSLint, JSHint tools.
* Build script now compresses all images in subfolders.
* Build script now versions files by SHA hash.
* Many `.htaccess` improvements including: disable directory browsing,
improved support for all versions of Apache, more robust and extensive
HTTP compression rules.
* Remove `handheld.css` as it has very poor device support.
* Remove touch-icon `link` elements from the HTML and include improved
touch-icon support.
* Remove the cache-busting query paramaters from files references in
the HTML.
* Remove IE6 PNGFix.
### 1.0.0 (March 21, 2011)
* Rewrite build script to make it more customizable and flexible.
* Add a humans.txt.
* Numerous `.htaccess` improvements (including inline documentation).
* Move the alternative server configurations to the H5BP server configs
repo.
* Use a protocol-relative url to reference jQuery and prevent mixed
content warnings.
* Optimize the Google Analytics snippet.
* Use Eric Meyer's recent CSS reset update and the HTML5 Doctor reset.
* More robust `sub`/`sup` CSS styles.
* Add keyboard `.focusable` helper class that extends `.visuallyhidden`.
* Print styles no longer print hash or JavaScript links.
* Add a print reset for IE's proprietary filters.
* Remove IE9-specific conditional class on the `html` element.
* Remove margins from lists within `nav` elements.
* Remove YUI profiling.

153
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,153 @@
# Contributing to HTML5 Boilerplate
♥ [HTML5 Boilerplate](https://html5boilerplate.com) and want to get involved?
Thanks! There are plenty of ways you can help!
Please take a moment to review this document in order to make the contribution
process easy and effective for everyone involved.
Following these guidelines helps to communicate that you respect the time of
the developers managing and developing this open source project. In return,
they should reciprocate that respect in addressing your issue or assessing
patches and features.
## Using the issue tracker
The [issue tracker](https://github.com/h5bp/html5-boilerplate/issues) is
the preferred channel for [bug reports](#bugs), [features requests](#features)
and [submitting pull requests](#pull-requests), but please respect the following
restrictions:
* Please **do not** use the issue tracker for personal support requests (use
[Stack Overflow](https://stackoverflow.com/questions/tagged/html5boilerplate)).
* Please **do not** derail or troll issues. Keep the discussion on topic and
respect the opinions of others.
* Please **do not** open issues or pull requests regarding the code in
[`.htaccess`](https://github.com/h5bp/server-configs-apache),
[`jQuery`](https://github.com/jquery/jquery/),
[`Modernizr`](https://github.com/Modernizr/Modernizr) or
[`Normalize.css`](https://github.com/necolas/normalize.css) (open them in
their respective repositories).
<a name="bugs"></a>
## Bug reports
A bug is a _demonstrable problem_ that is caused by the code in the repository.
Good bug reports are extremely helpful - thank you!
Guidelines for bug reports:
1. **Use the GitHub issue search** &mdash; check if the issue has already been
reported.
2. **Check if the issue has been fixed** &mdash; try to reproduce it using the
latest `master` or development branch in the repository.
3. **Isolate the problem** &mdash; ideally create a [reduced test
case](https://css-tricks.com/reduced-test-cases/) and a live example.
A good bug report shouldn't leave others needing to chase you up for more
information. Please try to be as detailed as possible in your report. What is
your environment? What steps will reproduce the issue? What browser(s) and OS
experience the problem? What would you expect to be the outcome? All these
details will help people to fix any potential bugs.
Example:
> Short and descriptive example bug report title
>
> A summary of the issue and the browser/OS environment in which it occurs. If
> suitable, include the steps required to reproduce the bug.
>
> 1. This is the first step
> 2. This is the second step
> 3. Further steps, etc.
>
> `<url>` - a link to the reduced test case
>
> Any other information you want to share that is relevant to the issue being
> reported. This might include the lines of code that you have identified as
> causing the bug, and potential solutions (and your opinions on their
> merits).
<a name="features"></a>
## Feature requests
Feature requests are welcome. But take a moment to find out whether your idea
fits with the scope and aims of the project. It's up to *you* to make a strong
case to convince the project's developers of the merits of this feature. Please
provide as much detail and context as possible.
<a name="pull-requests"></a>
## Pull requests
Good pull requests - patches, improvements, new features - are a fantastic
help. They should remain focused in scope and avoid containing unrelated
commits.
**Please ask first** before embarking on any significant pull request (e.g.
implementing features, refactoring code, porting to a different language),
otherwise you risk spending a lot of time working on something that the
project's developers might not want to merge into the project.
Please adhere to the coding conventions used throughout a project (indentation,
accurate comments, etc.) and any other requirements (such as test coverage).
Adhering to the following process is the best way to get your work
included in the project:
1. [Fork](https://help.github.com/articles/fork-a-repo/) the project, clone your
fork, and configure the remotes:
```bash
# Clone your fork of the repo into the current directory
git clone https://github.com/<your-username>/html5-boilerplate.git
# Navigate to the newly cloned directory
cd html5-boilerplate
# Assign the original repo to a remote called "upstream"
git remote add upstream https://github.com/h5bp/html5-boilerplate.git
```
2. If you cloned a while ago, get the latest changes from upstream:
```bash
git checkout master
git pull upstream master
```
3. Create a new topic branch (off the main project development branch) to
contain your feature, change, or fix:
```bash
git checkout -b <topic-branch-name>
```
4. Commit your changes in logical chunks. Please adhere to these [git commit
message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
or your code is unlikely be merged into the main project. Use Git's
[interactive rebase](https://help.github.com/articles/about-git-rebase/)
feature to tidy up your commits before making them public.
5. Locally merge (or rebase) the upstream development branch into your topic branch:
```bash
git pull [--rebase] upstream master
```
6. Push your topic branch up to your fork:
```bash
git push origin <topic-branch-name>
```
7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/)
with a clear title and description.
**IMPORTANT**: By submitting a patch, you agree to allow the project
owners to license your work under the terms of the [MIT License](LICENSE.txt).

View File

@@ -1,21 +1,19 @@
The MIT License
Copyright (c) HTML5 Boilerplate
Copyright (c) 2011 Corey Hart
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

92
README.md Normal file
View File

@@ -0,0 +1,92 @@
# [HTML5 Boilerplate](https://html5boilerplate.com)
[![Build Status](https://travis-ci.org/h5bp/html5-boilerplate.svg)](https://travis-ci.org/h5bp/html5-boilerplate)
[![devDependency Status](https://david-dm.org/h5bp/html5-boilerplate/dev-status.svg)](https://david-dm.org/h5bp/html5-boilerplate#info=devDependencies)
HTML5 Boilerplate is a professional front-end template for building
fast, robust, and adaptable web apps or sites.
This project is the product of many years of iterative development and
combined community knowledge. It does not impose a specific development
philosophy or framework, so you're free to architect your code in the
way that you want.
* Homepage: [https://html5boilerplate.com](https://html5boilerplate.com)
* Source: [https://github.com/h5bp/html5-boilerplate](https://github.com/h5bp/html5-boilerplate)
* Twitter: [@h5bp](https://twitter.com/h5bp)
## Quick start
Choose one of the following options:
1. Download the latest stable release from
[html5boilerplate.com](https://html5boilerplate.com/) or create a
custom build using [Initializr](http://www.initializr.com).
2. Clone the git repo — `git clone
https://github.com/h5bp/html5-boilerplate.git` - and checkout the
[tagged release](https://github.com/h5bp/html5-boilerplate/releases)
you'd like to use.
## Features
* HTML5 ready. Use the new elements with confidence.
* Designed with progressive enhancement in mind.
* Includes:
* [`Normalize.css`](https://necolas.github.com/normalize.css/)
for CSS normalizations and common bug fixes
* [`jQuery`](https://jquery.com/) via CDN, with a local fallback
* A custom build of [`Modernizr`](http://modernizr.com/) for feature
detection
* [`Apache Server Configs`](https://github.com/h5bp/server-configs-apache)
that, among other, improve the web site's performance and security
* Placeholder CSS Media Queries.
* Useful CSS helper classes.
* Default print styles, performance optimized.
* An optimized version of the Google Universal Analytics snippet.
* Protection against any stray `console` statements causing JavaScript
errors in older browsers.
* "Delete-key friendly." Easy to strip out parts you don't need.
* Extensive inline and accompanying documentation.
## Browser support
* Chrome *(latest 2)*
* Firefox *(latest 2)*
* Internet Explorer 8+
* Opera *(latest 2)*
* Safari *(latest 2)*
*This doesn't mean that HTML5 Boilerplate cannot be used in older browsers,
just that we'll ensure compatibility with the ones mentioned above.*
If you need legacy browser support (IE 6+, Firefox 3.6+, Safari 4+) you
can use [HTML5 Boilerplate v4](https://github.com/h5bp/html5-boilerplate/tree/v4),
but is no longer actively developed.
## Documentation
Take a look at the [documentation table of contents](dist/doc/TOC.md).
This documentation is bundled with the project, which makes it readily
available for offline reading and provides a useful starting point for
any documentation you want to write about your project.
## Contributing
Hundreds of developers have helped make the HTML5 Boilerplate what it is
today. Anyone and everyone is welcome to [contribute](CONTRIBUTING.md),
however, if you decide to get involved, please take a moment to review
the [guidelines](CONTRIBUTING.md):
* [Bug reports](CONTRIBUTING.md#bugs)
* [Feature requests](CONTRIBUTING.md#features)
* [Pull requests](CONTRIBUTING.md#pull-requests)
## License
The code is available under the [MIT license](LICENSE.txt).

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 640 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 747 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 640 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 640 B

View File

@@ -1,766 +0,0 @@
<?xml version="1.0"?>
<project name="Boilerplate Build" default="build" basedir="../"> <!-- one back since we're in build/ -->
<!-- Load in Ant-Contrib to give us access to some very useful tasks! -->
<!-- the .jar file is located in the tools directory -->
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="${basedir}/build/tools/ant-contrib-1.0b3.jar"/>
</classpath>
</taskdef>
<!-- load shell environment -->
<property environment="ENV" />
<!-- load property files -->
<property file="build/config/project.properties"/>
<property file="build/config/default.properties"/>
<!-- merge the stylesheet properties -->
<var name="stylesheet-files" value="${file.stylesheets}, ${file.default.stylesheets}"/>
<!-- merge the pages properties -->
<var name="page-files" value="${file.pages}, ${file.pages.default.include}"/>
<!--
*************************************************
* BASE TARGETS *
*************************************************
-->
<target name="basics">
<if>
<equals arg1="${env}" arg2="dev"/>
<then>
<!-- Build a dev environment -->
<echo message="Building a Development Environment..."/>
<antcall target="-basics.dev"/>
</then>
<elseif>
<equals arg1="${env}" arg2="test"/>
<then>
<!-- Build a test environment -->
<echo message="Building a Test Environment..."/>
<antcall target="-basics.test"/>
</then>
</elseif>
<else>
<!-- Build a production environment -->
<echo message="Building a Production Environment..."/>
<antcall target="-basics.production"/>
</else>
</if>
</target>
<target name="text">
<if>
<equals arg1="${env}" arg2="dev"/>
<then>
<!-- Build a dev environment -->
<echo message="Building a Development Environment..."/>
<antcall target="-text.dev"/>
</then>
<elseif>
<equals arg1="${env}" arg2="test"/>
<then>
<!-- Build a test environment -->
<echo message="Building a Test Environment..."/>
<antcall target="-text.test"/>
</then>
</elseif>
<else>
<!-- Build a production environment -->
<echo message="Building a Production Environment..."/>
<antcall target="-text.production"/>
</else>
</if>
<!-- funky order due to jpegtran being a jerk. See comment at top of imagesjpg task -->
<antcall target="-jpgcopy"/>
</target>
<target name="buildkit">
<if>
<equals arg1="${env}" arg2="dev"/>
<then>
<!-- Build a dev environment -->
<echo message="Building a Development Environment..."/>
<antcall target="-buildkit.dev"/>
</then>
<elseif>
<equals arg1="${env}" arg2="test"/>
<then>
<!-- Build a test environment -->
<echo message="Building a Test Environment..."/>
<antcall target="-buildkit.test"/>
</then>
</elseif>
<else>
<!-- Build a production environment -->
<echo message="Building a Production Environment..."/>
<antcall target="-buildkit.production"/>
</else>
</if>
</target>
<target name="build">
<if>
<equals arg1="${env}" arg2="dev"/>
<then>
<!-- Build a dev environment -->
<echo message="Building a Development Environment..."/>
<antcall target="-build.dev" />
</then>
<elseif>
<equals arg1="${env}" arg2="test"/>
<then>
<!-- Build a test environment -->
<echo message="Building a Test Environment..."/>
<antcall target="-build.test" />
</then>
</elseif>
<else>
<!-- Build a production environment -->
<echo message="Building a Production Environment..."/>
<antcall target="-build.production" />
</else>
</if>
</target>
<target name="minify">
<if>
<equals arg1="${env}" arg2="dev"/>
<then>
<!-- Build a dev environment -->
<echo message="Building a Development Environment..."/>
<antcall target="-minify.dev"/>
</then>
<elseif>
<equals arg1="${env}" arg2="test"/>
<then>
<!-- Build a test environment -->
<echo message="Building a Test Environment..."/>
<antcall target="-minify.test"/>
</then>
</elseif>
<else>
<!-- Build a production environment -->
<echo message="Building a Production Environment..."/>
<antcall target="-minify.production"/>
</else>
</if>
</target>
<!--
*************************************************
* BUILD TARGETS *
*************************************************
-->
<!-- Target: basics -->
<target name="-basics.dev"
depends="-rev,
-clean,
-copy"/>
<target name="-basics.test"
depends="-rev,
-clean,
-copy,
-usemin,
-js.all.minify,
-js.main.concat,
-js.mylibs.concat,
-js.scripts.concat,
-js.delete,
-css,
-html"/>
<target name="-basics.production"
depends="-rev,
-clean,
-copy,
-usemin,
-js.all.minify,
-js.main.concat,
-js.mylibs.concat,
-js.scripts.concat,
-js.delete,
-strip-console.log,
-css,
-html"/>
<!-- Target: text -->
<target name="-text.dev"
depends="-rev,
-clean,
-copy"/>
<target name="-text.test"
depends="-rev,
-clean,
-copy,
-usemin,
-js.all.minify,
-js.main.concat,
-js.mylibs.concat,
-js.scripts.concat,
-js.delete,
-css,
-html,
-htmlclean"/>
<target name="-text.production"
depends="-rev,
-clean,
-copy,
-usemin,
-js.all.minify,
-js.main.concat,
-js.mylibs.concat,
-js.scripts.concat,
-js.delete,
-strip-console.log,
-css,
-html,
-htmlclean"/>
<!-- Target: buildkit -->
<target name="-buildkit.dev"
depends="-rev,
-clean,
-copy,
-imagespng,
-imagesjpg"/>
<target name="-buildkit.test"
depends="-rev,
-clean,
-copy,
-usemin,
-js.all.minify,
-js.main.concat,
-js.mylibs.concat,
-js.scripts.concat,
-js.delete,
-css,
-html,
-htmlbuildkit,
-imagespng,
-imagesjpg"/>
<target name="-buildkit.production"
depends="-rev,
-clean,
-copy,
-usemin,
-js.all.minify,
-js.main.concat,
-js.mylibs.concat,
-js.scripts.concat,
-js.delete,
-strip-console.log,
-css,
-html,
-htmlbuildkit,
-imagespng,
-imagesjpg"/>
<!-- Target: build -->
<target name="-build.dev"
depends="-rev,
-clean,
-copy,
-imagespng,
-imagesjpg"/>
<target name="-build.test"
depends="-rev,
-clean,
-copy,
-usemin,
-js.all.minify,
-js.main.concat,
-js.mylibs.concat,
-js.scripts.concat,
-js.delete,
-css,
-html,
-htmlclean,
-imagespng,
-imagesjpg"/>
<target name="-build.production"
depends="-rev,
-clean,
-copy,
-usemin,
-js.all.minify,
-js.main.concat,
-js.mylibs.concat,
-js.scripts.concat,
-js.delete,
-strip-console.log,
-css,
-html,
-htmlclean,
-imagespng,
-imagesjpg"/>
<!-- Target: minify -->
<target name="-minify.dev"
depends="-rev,
-clean,
-copy,
-imagespng,
-imagesjpg"/>
<target name="-minify.test"
depends="-rev,
-clean,
-copy,
-usemin,
-js.all.minify,
-js.main.concat,
-js.mylibs.concat,
-js.scripts.concat,
-js.delete,
-css,
-html,
-htmlcompress,
-imagespng,
-imagesjpg"/>
<target name="-minify.production"
depends="-rev,
-clean,
-copy,
-usemin,
-js.all.minify,
-js.main.concat,
-js.mylibs.concat,
-js.scripts.concat,
-js.delete,
-strip-console.log,
-css,
-html,
-htmlcompress,
-imagespng,
-imagesjpg"/>
<!--
*************************************************
* FUNCTION TARGETS *
*************************************************
-->
<target name="-load-build-info" description="(PRIVATE) Loads the build versioning information">
<property file="./${dir.build}/config/${build.version.info}"/>
</target>
<target name="-clean" description="(PRIVATE) Wipe the previous build (Deletes the dir.publish directory">
<!-- This is a private target -->
<echo message="Cleaning up previous build directory..."/>
<delete dir="./${dir.publish}/"/>
</target>
<target name="-rev" description="(PRIVATE) Increase the current build number by one and set build date">
<!-- This is a private target -->
<echo message="Increasing the build number..."/>
<propertyfile file="./${dir.build}/config/${build.version.info}" comment="Build Information File - DO NOT CHANGE">
<entry key="build.number" type="int" default="0000" operation="+" pattern="0000"/>
<entry key="build.date" type="date" value="now" pattern="dd.MM.yyyy HH:mm"/>
</propertyfile>
<property file="./${dir.build}/config/${build.version.info}"/>
<echo>Creating build ${build.number}</echo>
</target>
<target name="current-number" depends="-load-build-info" description="(PUBLIC) Returns the current build number">
<echo>Current build number: ${build.number}</echo>
</target>
<target name="-copy" depends="-load-build-info">
<!-- This is a private target -->
<echo message="Copying over new files..."/>
<!-- combine the 2 exclude properties -->
<var name="excluded-files" value="${file.default.exclude}, ${file.exclude}"/>
<copy todir="./${dir.publish}">
<fileset dir="${dir.source}/" excludes="${excluded-files}"/>
</copy>
</target>
<!-- JAVASCRIPT -->
<target name="-js.main.concat" depends="-load-build-info" description="(PRIVATE) Concatenates the JS files in dir.js">
<echo message="Concatenating Main JS scripts..."/>
<concat destfile="./${dir.publish}/${dir.js}/scripts-${build.number}.js">
<fileset dir="./${dir.publish}/">
<include name="**/${dir.js.main}/*.min.js"/>
<exclude name="**/${dir.js.mylibs}/*.js"/>
<exclude name="**/${dir.js.libs}/*.js"/>
</fileset>
</concat>
</target>
<target name="-js.mylibs.concat" depends="-load-build-info" description="(PRIVATE) Concatenates the JS files in dir.js.mylibs">
<echo message="Concatenating JS libraries"/>
<concat destfile="./${dir.publish}/${dir.js}/libs-${build.number}.js">
<fileset dir="./${dir.publish}/${dir.js.mylibs}/">
<include name="**/*.min.js"/>
</fileset>
</concat>
</target>
<target name="-js.scripts.concat" depends="-load-build-info" if="build.concat.scripts">
<echo message="Concatenating library file with main script file"/>
<concat destfile="./${dir.publish}/${dir.js}/scripts-${build.number}.min.js">
<fileset dir="./${dir.publish}/${dir.js}/">
<include name="libs-${build.number}.js"/>
<include name="scripts-${build.number}.js"/>
</fileset>
</concat>
<echo message="Concatenating library file with main debug script file"/>
<concat destfile="./${dir.publish}/${dir.js}/scripts-${build.number}-debug.min.js">
<fileset dir="./${dir.publish}/${dir.js}/">
<include name="libs-${build.number}.js"/>
<include name="scripts-${build.number}-debug.js"/>
</fileset>
</concat>
</target>
<target name="-js.all.minify" depends="-js.libs.minify" description="(PRIVATE) Minifies the scripts.js files created by js.scripts.concat">
<echo message="Minifying concatenated script- and library-file"/>
<apply executable="java" parallel="false">
<fileset dir="./${dir.publish}/${dir.js}">
<include name="**/*.js"/>
<exclude name="**/*.min.js"/>
<exclude name="**/${dir.js.libs}/*.js"/>
</fileset>
<arg line="-jar"/>
<arg path="./${dir.build.tools}/${tool.yuicompressor}"/>
<srcfile/>
<arg line="--line-break"/>
<arg line="4000"/>
<arg line="-o"/>
<mapper type="glob" from="*.js" to="../${dir.publish}/${dir.js}/*.min.js"/>
<targetfile/>
</apply>
</target>
<target name="-js.libs.minify" depends="-load-build-info" description="(PRIVATE) Minifies the helper files in dir.js.libs">
<echo message="Minifying helper JS files..."/>
<apply executable="java" parallel="false">
<fileset dir="./${dir.publish}/${dir.js.libs}/" includes="*.js" excludes="*.min.js"/>
<arg line="-jar"/>
<arg path="./${dir.build.tools}/${tool.yuicompressor}"/>
<srcfile/>
<arg line="-o"/>
<mapper type="glob" from="*.js" to="../${dir.publish}/${dir.js.libs}/*-${build.number}.min.js"/>
<targetfile/>
</apply>
</target>
<target name="-js.delete" depends="-load-build-info" description="(PRIVATE) Deletes the unoptimized js files from build if set">
<if>
<equals arg1="${build.delete.unoptimized}" arg2="true"/>
<then>
<echo message="Deleting unoptimized files..."/>
<delete file="./${dir.publish}/${dir.js}/scripts-${build.number}.js"/>
<delete file="./${dir.publish}/${dir.js}/scripts-${build.number}-debug.js"/>
<!--
<delete dir="./${dir.publish}/${dir.js.lib}/"/>
<delete file="./${dir.publish}/${dir.js}/libs-${build.number}.js"/>
this guy probably COULD be on but I think it's better if we keep him off for now. ^pi
<delete includeemptydirs="true">
<fileset dir="./${dir.publish}/${dir.js.libs}/" includes="*.js" excludes="*.min.js"/>
</delete>
-->
</then>
</if>
<if>
<and>
<equals arg1="${build.delete.unoptimized}" arg2="true"/>
<equals arg1="${build.concat.scripts}" arg2="true"/>
</and>
<then>
<delete file="./${dir.publish}/${dir.js}/libs-${build.number}.js"/>
<delete file="./${dir.publish}/${dir.js}/scripts-${build.number}.js"/>
</then>
</if>
</target>
<target name="-strip-console.log" description="(PRIVATE)Comments out any console.log statements">
<echo message="Commenting out console.log lines"/>
<replaceregexp match="(console.log\(.*\))" replace="/\*\1\*/" flags="g" >
<fileset dir="./${dir.publish}/${dir.js}/">
<include name="**/*.js"/>
<exclude name="**/*.min.js"/>
</fileset>
</replaceregexp>
</target>
<!-- HTML -->
<target name="-usemin" depends="-serverconfig" description="(PRIVATE) Replaces references to non-minified scripts">
<echo message="Switching to minified js files..."/>
<!-- switch from a regular jquery to minified -->
<replaceregexp match="jquery-(\d|\d(\.\d)+)\.js" replace="jquery-\1.min.js" flags="">
<fileset dir="./${dir.publish}" includes="${page-files}"/>
</replaceregexp>
<!-- switch any google CDN reference to minified -->
<replaceregexp match="(\d|\d(\.\d)+)\/jquery\.js" replace="\1/jquery.min.js" flags="">
<fileset dir="./${dir.publish}" includes="${page-files}"/>
</replaceregexp>
<echo>kill off those versioning flags: ?v=2</echo>
<replaceregexp match='\?v=\d+">' replace='">' flags="">
<fileset dir="./${dir.publish}" includes="${page-files}"/>
</replaceregexp>
<echo>remove favicon reference if it is pointing to the root</echo>
<replaceregexp match="&lt;link rel=&quot;shortcut icon&quot; href=&quot;/favicon\.ico&quot;&gt;" replace="">
<fileset dir="./${dir.publish}" includes="${page-files}"/>
</replaceregexp>
<!-- we maintain the apple-touch-icon reference for Android 2.2 www.ravelrumba.com/blog/android-apple-touch-icon
<replace token="&lt;link rel=&quot;apple-touch-icon&quot; href=&quot;/apple-touch-icon.png&quot;>" value="">
<fileset dir="./${dir.publish}" includes="${page-files}"/>
</replace>
-->
</target>
<target name="-html" depends="-load-build-info" description="(PRIVATE) Very basic clean up of the HTML">
<echo message="Clean up the html..."/>
<!-- style.css replacement handled as a replacetoken above -->
<replaceregexp match="&lt;!-- scripts concatenated [\d\w\s\W]*?!-- end ((scripts)|(concatenated and minified scripts))--&gt;" replace="&lt;script src='${dir.js}/scripts-${build.number}.min.js\'&gt;&lt;/script&gt;" flags="m">
<fileset dir="./${dir.publish}" includes="${page-files}"/>
</replaceregexp>
<!--[! use comments like this one to avoid having them get minified -->
</target>
<target name="-htmlclean">
<apply executable="java" parallel="false" force="true" dest="./${dir.publish}/" >
<fileset dir="./${dir.publish}/" includes="${page-files}"/>
<arg value="-jar"/>
<arg path="./${dir.build}/tools/${tool.htmlcompressor}"/>
<arg line="--type html"/>
<arg line="--preserve-multi-spaces"/>
<arg line="--remove-quotes"/>
<arg line="--compress-js"/>
<arg line="--compress-css"/>
<srcfile/>
<arg value="-o"/>
<mapper type="glob" from="*.html" to="../${dir.publish}/*.html"/>
<targetfile/>
</apply>
</target>
<target name="-htmlbuildkit">
<apply executable="java" parallel="false" force="true" dest="./${dir.publish}/" >
<fileset dir="./${dir.publish}/" includes="${page-files}"/>
<arg value="-jar"/>
<arg path="./${dir.build}/tools/${tool.htmlcompressor}"/>
<arg value="--preserve-comments"/>
<arg line="--preserve-multi-spaces"/>
<arg line="--type html"/>
<arg line="--compress-js"/>
<arg line="--compress-css"/>
<srcfile/>
<arg value="-o"/>
<mapper type="glob" from="*.html" to="../${dir.publish}/*.html"/>
<targetfile/>
</apply>
</target>
<target name="-htmlcompress">
<apply executable="java" parallel="false" force="true" dest="./${dir.publish}/" >
<fileset dir="./${dir.publish}/" includes="${page-files}"/>
<arg value="-jar"/>
<arg path="./${dir.build}/tools/${tool.htmlcompressor}"/>
<arg line="--type html"/>
<arg line="--remove-quotes"/>
<arg line="--compress-js"/>
<arg line="--compress-css"/>
<srcfile/>
<arg value="-o"/>
<mapper type="glob" from="*.html" to="../${dir.publish}/*.html"/>
<targetfile/>
</apply>
</target>
<target name="-serverconfig" description="(PRIVATE) Upgrades expires headers">
<echo message="Upgrading expires header timeouts for js/css"/>
<replace file="./${dir.publish}/${file.serverconfig}" token="access plus 2 months" value="access plus 1 year"/>
</target>
<!-- CSS -->
<target name="-css" depends="-load-build-info" description="Concatenates and Minifies any stylesheets listed in the file.stylesheets property">
<echo message="Minifying css..."/>
<concat destfile="./${dir.publish}/${dir.css}/style-${build.number}.css">
<filelist dir="./${dir.publish}/${dir.css}" files="${stylesheet-files}"/>
</concat>
<apply executable="php" parallel="false">
<fileset dir="./${dir.publish}/${dir.css}/" includes="style-${build.number}.css"/>
<arg line="-f"/>
<arg path="./${dir.build.tools}/${tool.csscompressor}"/>
<srcfile/>
<redirector>
<outputmapper type="glob" from="style-${build.number}.css" to="./${dir.publish}/${dir.css}/style-${build.number}.min.css"/>
</redirector>
</apply>
<replace token="style.css" value="style-${build.number}.min.css" dir="${dir.publish}" includes="${page-files}"/>
</target>
<!-- IMAGES -->
<target name="-imagespng" description="(PRIVATE) Optimizes .png images using optipng">
<echo message="Optimizing images..."/>
<echo message="This part might take a while. But the rest of everything is already done."/>
<echo message="First, we run optipng on the .png files..."/>
<!-- osfamily=unix is actually true on OS X as well -->
<!-- On *nix's and OS X, check for optipng and give a helpful message if it's not installed -->
<if>
<and>
<os family="unix" />
<available file="optipng" filepath="${ENV.PATH}" />
</and>
<then>
<apply executable="optipng" osfamily="unix">
<arg value="-quiet"/>
<arg value="-o7"/>
<fileset dir="./${dir.publish}/">
<include name="**/*.png"/>
</fileset>
</apply>
</then>
<elseif>
<os family="unix" />
<then>
<echo message="*** optipng NOT INSTALLED. SKIPPING OPTIMIZATION OF PNGs." />
<echo message="*** Install optipng to enable png optimization." />
<echo message="*** For instructions see 'Dependencies' at: http://html5boilerplate.com/docs/#Build-script#dependencies" />
</then>
</elseif>
</if>
<apply executable="tools/optipng-0.6.4-exe/optipng.exe" osfamily="windows">
<arg value="-o7"/>
<arg value="-quiet"/>
<fileset dir="./${dir.publish}/">
<include name="**/*.png"/>
</fileset>
</apply>
</target>
<target name="-imagesjpg" description="(PRIVATE) Optimizes .jpg images using jpegtan">
<echo message="Now, we clean up those jpgs..."/>
<!-- jpegtran is a little weird in that it assumes a pre-existing file means it's already optimized. -->
<!-- why? good question. To combat this, we skipped copying over the ${dir.images}/*.jpg earlier in the -->
<!-- copy task. Now, we're using jpegtran to copy the files over while we crunch 'em. -->
<if>
<equals arg1="${images.strip.metadata}" arg2="true"/>
<then>
<var name="strip-meta-tags" value="none"/>
</then>
<else>
<var name="strip-meta-tags" value="all"/>
</else>
</if>
<!-- On *nix's and OS X, check for jpegtran and give a helpful message if it's not installed -->
<if>
<and>
<os family="unix" />
<available file="jpegtran" filepath="${ENV.PATH}" />
</and>
<then>
<apply executable="jpegtran" osfamily="unix">
<fileset dir="./${dir.images}" includes="*.jpg"/>
<arg value="-copy"/>
<arg value="${strip-meta-tags}"/>
<arg value="-optimize"/>
<srcfile/>
<redirector>
<outputmapper type="glob" from="*.jpg" to="./${dir.publish}/${dir.images}/*.jpg"/>
</redirector>
<!-- you may want to flag optimized images. If so, do it here. Otherwise change this to type="identity" -->
</apply>
</then>
<elseif>
<os family="unix" />
<then>
<echo message="*** jpegtran NOT INSTALLED. SKIPPING OPTIMIZATION OF JPEGs." />
<echo message="*** Install jpegtran to enable jpeg optimization." />
<echo message="*** For instructions see 'Dependencies' at: http://html5boilerplate.com/docs/#Build-script#dependencies" />
</then>
</elseif>
</if>
<apply executable="tools/jpegtran.exe" osfamily="windows">
<fileset dir="./${dir.images}" includes="*.jpg"/>
<arg value="-copy"/>
<arg value="${strip-meta-tags}"/>
<arg value="-optimize"/>
<srcfile/>
<targetfile/>
<!-- you may want to flag optimized images. If so, do it here. Otherwise change this to type="identity" -->
<mapper type="glob" from="*.jpg" to="../${dir.publish}/${dir.images}/*.jpg"/>
</apply>
</target>
<target name="-jpgcopy">
<echo message="Copying over the unmodified jpegs."/>
<copy todir="./${dir.publish}/${dir.images}">
<fileset dir="${dir.source}/${dir.images}" includes="*.jpg"/>
</copy>
</target>
</project>

View File

@@ -1,3 +0,0 @@
# build.properties file defines overrides for default.properties
# Explanation: This file should be created by each user as and when he or she needs to override particular values.
# Consequently, it should not be placed under version control.

View File

@@ -1,80 +0,0 @@
#
# Default Build Settings
# you can override these settings on a project basis in a project.properties file
# so probably best not to touch these as they could be overwritten in later versions!
#
#
# Directory Paths
#
dir.source = .
dir.publish = publish
dir.build = build
dir.build.tools = ${dir.build}/tools
dir.test = test
dir.demo = demo
dir.js = js
dir.js.main = ${dir.js}
# scripts in the lib direcotry will only be minified, not concatenated together
dir.js.libs = ${dir.js}/libs
dir.js.mylibs = ${dir.js}/mylibs
dir.css = css
dir.images = img
#
# HTML, PHP, etc files to clean and update script/css references
#
file.pages.default.include = index.html, 404.html
# You will need to include the property file.pages.include in your project.properties file
# and add any extra pages you want to be updated by the scripts in a comma separated lis
# the server configuration you're going with. If you don't use apache,
# get a different one here: github.com/paulirish/html5-boilerplate-server-configs
file.serverconfig = .htaccess
#
# Files not to be copied over by the script to the publish directory
#
file.default.exclude = .gitignore, .project, .settings, README.markdown, README.md, ${dir.images}/*.jpg, **/.git/**, **/.svn/**, **/${dir.build}/**, **/${dir.test}/**, **/${dir.demo}/**
# Declare the file.exclude property in your project.properties file if you want to exclude files / folders you have added
# Note: you cannot decalre an empty file.exclude property
#
# Default Styleshee
#
file.default.stylesheets = style.css
#
# Script Optimisation
#
# If set, concat libraries with main scripts file, producing single script file
build.concat.scripts = true
# If set, delete minified but unconcatted files.
build.delete.unoptimized = true
#
# Image Optimisation
#
images.strip.metadata = true
# Seting this to true will strip the metadata from all jpeg files.
# YOU SHOULD ONLY DO THIS IF YOU OWN THE COPYRIGHT TO ALL THE IMAGES IN THE BUILD
# Build Info
build.version.info = buildinfo.properties
build.scripts.dir = ${dir.build}/build-scripts
# Tools
tool.yuicompressor = yuicompressor-2.4.2.jar
tool.htmlcompressor = htmlcompressor-0.9.9.jar
tool.csscompressor = css-compressor/cli.php

View File

@@ -1,55 +0,0 @@
# project.properties file defines overrides for default.properties
# Explanation: This file should be created by each user as and when he or she needs to override particular values.
# Consequently, it should not be placed under version control.
# Stylesheets
#
# Note: Stylesheets will be concatenated in the order they are listed in the file.stylesheets property (i.e. the las
# file listed will be at the end of the concatenated file), so it probably makes sense to have the main style.css file
# as the first entry
# Example:
# file.stylesheets = style.css, lightbox.css, plugin.css
#
file.stylesheets =
# Web Pages
#
# These are the pages (files) that will be served to users (.html, .php, .asp, etc). Files in this property will
# be minified / optimised and have any stylesheet or javascript references updated to the minified examples
#
# The paths need to be relative
#
# Files can be added in a comma separated form
file.pages =
# Excluded files and dirs
#
# Add any files or directories you add to the project and do not want to be copied to the publish directory as a
# comma separated lis
# These files are ignored in addition to the default ones specified in default.properties.
file.exclude =
# Specify an environment to build
#
# By Default, it builds a production environmen
# Set to dev if buidling a development environmen
# Set to test if building a test environmen
env =
# Directory Structure
#
# Override any directory paths specific to this projec
#
# dir.publish
# dir.js
# dir.js.libs
# dir.js.mylibs
# dir.css
# dir.images

View File

@@ -1,42 +0,0 @@
#!/usr/bin/env bash
#Generate a new project from your HTML5 Boilerplate repo clone
#Created 2010-10-13, Rick Waldron
##first run
# $ cd html5-boilerplate/build
# $ chmod +x createproject.sh && ./createproject.sh
##usage
# $ cd html5-boilerplate/build
# $ ./createproject.sh
# find project root (also ensure script is ran from within repo)
src=$(git rev-parse --show-toplevel) || exit 1
# get a name for new project
while [[ -z $name ]]
do
echo "To create a new html5-boilerplate project, enter a new directory name:"
read name || exit
done
dst=$src/../$name
if [[ -d $dst ]]
then
echo "$dst exists"
else
#create new project
mkdir "$dst" || exit 1
#sucess message
echo "Created Directory: $dst"
cd "$src"
cp -vr css/ js/ img/ *.html *.xml *.txt *.png *.ico .htaccess "$dst"
#sucess message
echo "Created Project: $dst"
fi

View File

@@ -1,5 +0,0 @@
# This is for windows users only.
# If you're on a mac or linux, just run `ant build` from this folder in Terminal
set MYDIR=%~dp0
ant build

Binary file not shown.

View File

@@ -1,465 +0,0 @@
<?php
/**
* CSS Compressor [VERSION]
* [DATE]
* Corey Hart @ http://www.codenothing.com
*/
// Static dependencies, Subclasses loaded ondemand
require( dirname(__FILE__) . '/lib/Exception.php' );
require( dirname(__FILE__) . '/lib/Control.php' );
Class CSSCompression
{
/**
* CSSCompression Info
*
* @const (string) VERSION: Release version
* @const (string) DATE: Release date
*/
const VERSION = "[VERSION]";
const DATE = "[DATE]";
/**
* WARNING: This should ALWAYS BE FALSE in production
* When DEV is true, backdoor access to private methods is opened.
* Only used for unit testing and development.
*/
const DEV = true;
/**
* TOKEN is a special string that gets used as a marker within
* the compressor, and is removed before final output. Make sure
* this token is unique to your stylsheets.
*
* NOTE: This string gets used in regular expressions, and escaping
* won't help, so don't pick a complicated token.
*/
const TOKEN = "@____CSSCOMPRESSION_TOKEN____@";
/**
* The default set of options for every instance.
*/
public static $defaults = array(
// Converts long color names to short hex names
// (aliceblue -> #f0f8ff)
'color-long2hex' => true,
// Converts rgb colors to hex
// (rgb(159,80,98) -> #9F5062, rgb(100%) -> #FFFFFF)
'color-rgb2hex' => true,
// Converts long hex codes to short color names (#f5f5dc -> beige)
// Only works on latest browsers, careful when using
'color-hex2shortcolor' => false,
// Converts long hex codes to short hex codes
// (#44ff11 -> #4f1)
'color-hex2shorthex' => true,
// Converts hex codes to safe CSS Level 1 color names
// (#F00 -> red)
'color-hex2safe' => true,
// Converts font-weight names to numbers
// (bold -> 700)
'fontweight2num' => true,
// Removes zero decimals and 0 units
// (15.0px -> 15px || 0px -> 0)
'format-units' => true,
// Lowercases html tags from list
// (BODY -> body)
'lowercase-selectors' => true,
// Converts id and class attribute selectors, to their short selector counterpart
// (div[id=blah][class=moreblah] -> div#blah.moreblah)
'attr2selector' => true,
// Promotes nested id's to the front of the selector
// (body>div#elem p -> $elem p)
'strict-id' => false,
// Add space after pseudo selectors, for ie6
// (a:first-child{ -> a:first-child {)
'pseudo-space' => false,
// Compresses single defined multi-directional properties
// (margin: 15px 25px 15px 25px -> margin:15px 25px)
'directional-compress' => true,
// Combines multiply defined selectors and details
// (p{color:blue;} p{font-size:12pt} -> p{color:blue;font-size:12pt;})
// (p{color:blue;} a{color:blue;} -> p,a{color:blue;})
'organize' => true,
// Combines color/style/width properties
// (border-style:dashed;border-color:black;border-width:4px; -> border:4px dashed black)
'csw-combine' => true,
// Combines cue/pause properties
// (cue-before: url(before.au); cue-after: url(after.au) -> cue:url(before.au) url(after.au))
'auralcp-combine' => true,
// Combines margin/padding directionals
// (margin-top:10px;margin-right:5px;margin-bottom:4px;margin-left:1px; -> margin:10px 5px 4px 1px;)
'mp-combine' => true,
// Combines border directionals
// (border-top|right|bottom|left:1px solid black -> border:1px solid black)
'border-combine' => true,
// Combines font properties
// (font-size:12pt; font-family: arial; -> font:12pt arial)
'font-combine' => true,
// Combines background properties
// (background-color: black; background-image: url(bgimg.jpeg); -> background:black url(bgimg.jpeg))
'background-combine' => true,
// Combines list-style properties
// (list-style-type: round; list-style-position: outside -> list-style:round outside)
'list-combine' => true,
// Combines border-radius properties
// {
// border-top-left-radius: 10px;
// border-top-right-radius: 10px;
// border-bottom-right-radius: 10px;
// border-bottom-left-radius: 10px;
// }
// -> { border-radius: 10px; }
'border-radius-combine' => true,
// Removes the last semicolon of a property set
// ({margin: 2px; color: blue;} -> {margin: 2px; color: blue})
'unnecessary-semicolons' => true,
// Removes multiple declarations within the same rule set
'rm-multi-define' => true,
// Adds all unknown blocks to the top of the output in a comment strip
// Purely for bug reporting, but also useful to know what isn't being handled
'add-unknown' => true,
// Readibility of Compressed Output, Defaults to none
'readability' => 0,
);
/**
* Modes are predefined sets of configuration for referencing. When creating a mode, all options are set to true,
* and the mode array defines which options are to be false
*
* @mode safe: Safe mode does zero combinations or organizing. It's the best mode if you use a lot of hacks
* @mode sane: Sane mode does most combinations(multiple long hand notations to single shorthand),
* --- but still keeps most declarations in their place
* @mode small: Small mode reorganizes the whole sheet, combines as much as it can, and will break most comment hacks
* @mode full: Full mode does everything small does, but also converts hex codes to their short color name alternatives
*/
private static $modes = array(
'safe' => array(
'color-hex2shortcolor' => false,
'attr2selector' => false,
'strict-id' => false,
'organize' => false,
'csw-combine' => false,
'auralcp-combine' => false,
'mp-combine' => false,
'border-combine' => false,
'font-combine' => false,
'background-combine' => false,
'list-combine' => false,
'border-radius-combine' => false,
'rm-multi-define' => false,
),
'sane' => array(
'color-hex2shortcolor' => false,
'strict-id' => false,
'organize' => false,
'font-combine' => false,
'background-combine' => false,
'list-combine' => false,
'rm-multi-define' => false,
),
'small' => array(
'color-hex2shortcolor' => false,
'pseudo-space' => false,
),
'full' => array(
'pseudo-space' => false,
),
);
/**
* Readability Constants
*
* @param (int) READ_MAX: Maximum readability of output
* @param (int) READ_MED: Medium readability of output
* @param (int) READ_MIN: Minimal readability of output
* @param (int) READ_NONE: No readability of output (full compression into single line)
*/
const READ_MAX = 3;
const READ_MED = 2;
const READ_MIN = 1;
const READ_NONE = 0;
/**
* Static Helpers
*
* @instance express: Use a separate instance from singleton access
* @instance instance: Saved instance of CSSCompression
* @param (array) instances: Array of stored instances
* @param (array) rjson: Comment removal before json decoding
*/
private static $express;
private static $instance;
private static $instances = array();
private static $rjson = array(
'patterns' => array(
"/^(.*?){/s",
"/(\t|\s)+\/\/.*/",
),
'replacements' => array(
'{',
'',
),
);
/**
* Controller Instance
*/
private $Control;
/**
* Builds the subclasses, runs the compression if css passed, and merges options
*
* @param (string) css: CSS to compress on initialization if needed
* @param (array) options: Array of preferences to override the defaults
*/
public function __construct( $css = NULL, $options = NULL ) {
$this->Control = new CSSCompression_Control( $this );
// Autorun against css passed
if ( $css ) {
// Allow passing options/mode only
if ( is_array( $css ) || array_key_exists( $css, self::$modes ) ) {
$this->Control->Option->merge( $css );
}
else {
$this->Control->compress( $css, $options );
}
}
// Merge passed options
else if ( $options ) {
$this->Control->Option->merge( $options );
}
}
/**
* (Proxy function) Control access to properties
*
* - Getting stats/_mode/css returns the current value of that property
* - Getting options will return the current full options array
* - Getting anything else returns that current value in the options array or NULL
*
* @param (string) name: Name of property that you want to access
*/
public function __get( $name ) {
return $this->Control->get( $name );
}
/**
* (Proxy function) The setter method only allows
* access to setting values in the options array
*
* @param (string) name: Key name of the option you want to set
* @param (mixed) value: Value of the option you want to set
*/
public function __set( $name, $value ) {
return $this->Control->set( $name, $value );
}
/**
* (Proxy function) Merges a predefined set options
*
* @param (string) mode: Name of mode to use.
*/
public function mode( $mode = NULL ) {
return $this->Control->Option->merge( $mode );
}
/**
* Creates a new mode, or overwrites existing mode
*
* @param (mixed) mode: Name of the mode, or array of modes
* @param (array) config: Configuration of the mode
*/
public static function modes( $mode = NULL, $config = NULL ) {
if ( $mode === NULL ) {
return self::$modes;
}
else if ( is_array( $mode ) ) {
return array_merge( self::$modes, $mode );
}
else if ( $config === NULL ) {
return isset( self::$modes[ $mode ] ) ? self::$modes[ $mode ] : NULL;
}
else {
return self::$modes[ $mode ] = $config;
}
}
/**
* (Proxy function) Maintainable access to the options array
*
* - Passing no arguments returns the entire options array
* - Passing a single name argument returns the value for the option
* - Passing an array will merge the options with the array passed, for object like extension
* - Passing both a name and value, sets the value to the name key, and returns the value
*
* @param (mixed) name: The key name of the option
* @param (mixed) value: Value to set the option
*/
public function option( $name = NULL, $value = NULL ) {
return $this->Control->Option->option( $name, $value );
}
/**
* (Proxy function) Run compression on the sheet passed.
*
* @param (string) css: Stylesheet to be compressed
* @param (mixed) options: Array of options or mode to use.
*/
public function compress( $css = NULL, $options = NULL ) {
return $this->Control->compress( $css, $options );
}
/**
* Static access for direct compression
*
* @param (string) css: Stylesheet to be compressed
* @param (mixed) options: Array of options or mode to use.
*/
public static function express( $css = NULL, $options = NULL ) {
if ( ! self::$express ) {
self::$express = new CSSCompression();
}
self::$express->reset();
return self::$express->compress( $css, $options );
}
/**
* (Proxy Function) Cleans out compressor and it's subclasses to defaults
*
* @params none
*/
public function reset(){
return $this->Control->reset();
}
/**
* (Proxy Function) Cleans out class variables for next run
*
* @params none
*/
public function flush(){
return $this->Control->flush();
}
/**
* The Singleton access method (for those that want it)
*
* @param (string) name: Name of the stored instance
*/
public static function getInstance( $name = NULL ) {
if ( $name !== NULL ) {
if ( ! isset( self::$instances[ $name ] ) ) {
self::$instances[ $name ] = new self;
}
return self::$instances[ $name ];
}
else if ( ! self::$instance ) {
self::$instance = new self;
}
return self::$instance;
}
/**
* Reads JOSN based files, strips comments and converts to array
*
* @param (string) file: Filename
*/
public static function getJSON( $file ) {
// Assume helper file if full path not given
$file = $file[ 0 ] == '/' ? $file : dirname(__FILE__) . '/helpers/' . $file;
// Strip comments
$json = preg_replace( self::$rjson['patterns'], self::$rjson['replacements'], file_get_contents( $file ) );
// Decode json
$json = json_decode( $json, true );
// Check for errors
if ( $json === NULL ) {
$e = '';
// JSON Errors, taken directly from http://php.net/manual/en/function.json-last-error.php
switch( json_last_error() ) {
case JSON_ERROR_NONE:
$e = 'No error has occurred';
break;
case JSON_ERROR_DEPTH:
$e = 'The maximum stack depth has been exceeded';
break;
case JSON_ERROR_CTRL_CHAR:
$e = 'Control character error, possibly incorrectly encoded';
break;
case JSON_ERROR_STATE_MISMATCH:
$e = 'Invalid or malformed JSON';
break;
case JSON_ERROR_SYNTAX:
$e = 'Syntax error';
break;
case JSON_ERROR_UTF8:
$e = 'Malformed UTF-8 characters, possibly incorrectly encoded';
break;
default:
$e = 'Unknown JSON Error';
break;
}
throw new CSSCompression_Exception( "JSON Error in $file: $e" );
}
// Good to go
return $json;
}
/**
* Backdoor access to subclasses
* ONLY FOR DEVELOPMENT/TESTING.
*
* @param (string) class: Name of the focus class
* @param (string) method: Method function to call
* @param (array) args: Array of arguments to pass in
*/
public function access( $class = NULL, $method = NULL, $args = NULL ) {
if ( ! self::DEV ) {
throw new CSSCompression_Exception( "CSSCompression is not in development mode." );
}
else if ( $class === NULL || $method === NULL || $args === NULL ) {
throw new CSSCompression_Exception( "Invalid Access Call." );
}
else if ( ! is_array( $args ) ) {
throw new CSSCompression_Exception( "Expecting array of arguments." );
}
return $this->Control->access( $class, $method, $args );
}
};
?>

View File

@@ -1,22 +0,0 @@
#
# CSS Compression [VERSION] Change Log
# [DATE]
# Corey Hart @ http://www.codenothing.com
#
# Compressor Additions
- Configuration Modes
- pseduo-space, add space between pseduo selectors and comma/brace for ie6
- removing leading 0 of a decimal, 0.633px -> .633px
- handling all At Rules (charsets,media,imports,font-family,etc..)
- handling ms filter paths
- More css hacks support, including box-modal hack
- attr2selector, Convert id=blah and class=blah attributes to their selector counterparts
- strict-id, removes all selectors up to the last id
- add-unknown, adds unknown blocks to top of output in a comment
# Codebase Changes
- Converted to subclass architecture, more modular.
- Using JSON based sandbox specs for focused unit tests.
- Helper conversion definitions(long2hex, hex2short) are now in JSON based files.
- Added benchmark/regression testing

View File

@@ -1,228 +0,0 @@
<?php
/**
* CSS Compressor [VERSION]
* [DATE]
* Corey Hart @ http://www.codenothing.com
*/
require( dirname(__FILE__) . '/CSSCompression.php' );
Class CSSCompression_Cli
{
/**
* Cli Patterns
*
* @param (CSSCompression instance) instance: CSSCompression instance
* @param (array) args: Array of command line arguments
* @param (array) options: Array of options read from cli arguments
* @param (boolean) imports: Read import paths from the filesystem, and inject them into the script
* @param (string) mode: Compression mode
* @param (string) cwd: Current working directory
* @param (string) content: CSS Sheets read
* @param (regex) rcss: Matches css file name extension
* @param (regex) rprefix: Matches absolute paths
* @param (regex) rmarker: Marking points in css files when parsing for imports
* @param (regex) rquote: Unescaped quote
* @param (regex) rsinglequote: Unescaped single quote
* @param (regex) rsemicolon: Unescaped semicolon
* @param (regex) rimporturl: Import statement in a url() wrapper
* @param (regex) rimportstr: Import statement in a string wrapper
* @param (regex) rabsolutepath: Absolute path checker for import urls
* @param (regex) rfsabsolutepath: Matches absolute paths for the file system
*/
private $instance;
private $args = array();
private $options = array();
private $files = array();
private $imports = true;
private $mode = 'safe';
private $cwd = '';
private $content = '';
private $rcss = "/\.css$/";
private $rchopfile= "/\/[^\/]*$/";
private $rmarker = "/(\/\*|\"|'|@import)/";
private $rquote = "/(?<!\\\)\"/";
private $rsinglequote = "/(?<!\\\)'/";
private $rsemicolon = "/(?<!\\\);/";
private $rimporturl = "/^@import url\(['\"]?(.*?)['\"]?\)/";
private $rimportstr = "/^@import ['\"](.*?)['\"]/";
private $rabsolutepath = "/^(https?:\/\/|\/)/";
private $rfsabsolutepath = "/^(\/|\~\/|\\\|[a-z]:(\\\|\/)?)/i";
/**
* Run the compression across files passed to cli
*
* @param (array) args: Array of argument passed over the command line
*/
public function __construct( $args = array() ) {
// Render arguments
$this->cwd = getcwd() . DIRECTORY_SEPARATOR;
$this->args = $args;
$this->read();
// Run the files through the css compressor
$this->render();
}
/**
* Reads the cli arguments and puts them in their place
*
* @params none
*/
private function read(){
while ( count( $this->args ) ) {
$arg = array_shift( $this->args );
// Adding contents of css files
if ( preg_match( $this->rcss, $arg ) ) {
// Handle absolute path prefixing
if ( ! preg_match( $this->rfsabsolutepath, $arg ) && strpos( $arg, $this->cwd ) === false) {
$path = $this->cwd . $arg;
}
else {
$path = $arg;
}
$this->content .= $this->imports( $path );
}
// Longhand options
else if ( substr( $arg, 0, 2 ) == '--' ) {
$parts = explode( '=', $arg, 2 );
$name = substr( $parts[ 0 ], 2 );
$value = isset( $parts[ 1 ] ) ? $parts[ 1 ] : true;
if ( $name == 'mode' ) {
$this->mode = $value;
}
else if ( $name == 'imports' ) {
$this->imports = true;
}
else {
// Argument value is passed as string,
// convert to boolean as needed
if ( $value == 'false' ) {
$value = false;
}
else if ( $value == 'true' ) {
$value = true;
}
else {
$value = intval( $value );
}
$this->options[ $name ] = $value;
}
}
// Shorthand options
else if ( substr( $arg, 0, 1 ) == '-' && strlen( $arg ) == 2 ) {
$char = substr( $arg, 1, 1 );
if ( $char == 'i' ) {
$this->imports = true;
}
}
}
}
/**
* Scans the css file for import defns
*
* @param (path) file: Path to the stylesheet passed as an argument
*/
private function imports( $file ) {
// Set the content and the directory of the stylesheet
$content = file_get_contents( $file );
$cwd = preg_replace( $this->rchopfile, '/', $file );
// Block import fixing if not set
if ( $this->imports === false ) {
return $content;
}
$pos = 0;
while ( preg_match( $this->rmarker, $content, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
$marker = $match[ 1 ][ 0 ];
if ( $marker == '/*' ) {
if ( ( $pos = strpos( $content, '*/', $match[ 1 ][ 1 ] ) ) === false ) {
break;
}
}
else if ( $marker == '"' ) {
if ( preg_match( $this->rquote, $content, $m, PREG_OFFSET_CAPTURE, $match[ 1 ][ 1 ] + 1 ) ) {
$pos = $m[ 0 ][ 1 ] + 2;
}
else {
break;
}
}
else if ( $marker == "'" ) {
if ( preg_match( $this->rsinglequote, $content, $m, PREG_OFFSET_CAPTURE, $match[ 1 ][ 1 ] + 1 ) ) {
$pos = $m[ 0 ][ 1 ] + 2;
}
else {
break;
}
}
else if ( $marker == '@import' ) {
list ( $content, $pos ) = $this->inject( $content, $cwd, $match[ 1 ][ 1 ] );
}
else {
throw new CSSCompression_Exception( 'Unknown Import Error' );
}
}
return $content;
}
/**
* Replaces the import declaration with it's contents
*
* @param (string) content: Contents of the stylesheet
* @param (path) cwd: Directory of the current stylesheet
* @param (int) pos: Position of the import declaration
*/
private function inject( $content, $cwd, $pos ) {
if ( ! preg_match( $this->rsemicolon, $content, $m, PREG_OFFSET_CAPTURE, $pos ) ) {
throw new CSSCompression_Exception( "@import stmt at character position $pos, has no line-ending semicolon." );
}
$import = substr( $content, $pos, $m[ 0 ][ 1 ] + 1 - $pos );
// Check for valid import stmt, and replace into it the imports contents
if ( ( preg_match( $this->rimporturl, $import, $m ) || preg_match( $this->rimportstr, $import, $m ) ) &&
! preg_match( $this->rabsolutepath, $m[ 1 ] ) ) {
if ( ! file_exists( $cwd . $m[ 1 ] ) ) {
throw new CSSCompression_Exception( "Import Path '" . $cwd . $m[ 1 ] . "' not found." );
}
$content = substr_replace( $content, file_get_contents( $cwd . $m[ 1 ] ), $pos, strlen( $import ) );
}
else {
$pos += strlen( $import );
}
return array( $content, $pos );
}
/**
* Outputs the compression of the content read
*
* @params none
*/
private function render(){
$this->instance = new CSSCompression();
if ( $this->mode ) {
$this->instance->mode( $this->mode );
}
if ( $this->options ) {
$this->instance->option( $this->options );
}
echo $this->instance->compress( $this->content );
}
};
// Auto-initialize the cli script
new CSSCompression_Cli( $_SERVER['argv'] );
?>

View File

@@ -1,39 +0,0 @@
/**
* CSS Compressor [VERSION]
* [DATE]
* Corey Hart @ http://www.codenothing.com
*/
{
"#f0ffff":"azure",
"#f5f5dc":"beige",
"#ffe4c4":"bisque",
"#a52a2a":"brown",
"#ff7f50":"coral",
"#ffd700":"gold",
"#808080":"gray",
"#008000":"green",
"#4b0082":"indigo",
"#fffff0":"ivory",
"#f0e68c":"khaki",
"#faf0e6":"linen",
"#800000":"maroon",
"#000080":"navy",
"#808000":"olive",
"#ffa500":"orange",
"#da70d6":"orchid",
"#cd853f":"peru",
"#ffc0cb":"pink",
"#dda0dd":"plum",
"#800080":"purple",
"#ff0000":"red",
"#fa8072":"salmon",
"#a0522d":"sienna",
"#c0c0c0":"silver",
"#fffafa":"snow",
"#d2b48c":"tan",
"#008080":"teal",
"#ff6347":"tomato",
"#ee82ee":"violet",
"#f5deb3":"wheat",
"#f00":"red"
}

View File

@@ -1,16 +0,0 @@
/**
* CSS Compressor [VERSION]
* [DATE]
* Corey Hart @ http://www.codenothing.com
*/
{
"#808080":"gray",
"#008000":"green",
"#800000":"maroon",
"#000080":"navy",
"#808000":"olive",
"#ff0000":"red",
"#c0c0c0":"silver",
"#008080":"teal",
"#f00":"red"
}

View File

@@ -1,127 +0,0 @@
/**
* CSS Compressor [VERSION]
* [DATE]
* Corey Hart @ http://www.codenothing.com
*/
{
"aliceblue":"#f0f8ff",
"antiquewhite":"#faebd7",
"aquamarine":"#7fffd4",
"bisque":"#ffe4c4",
"black":"#000000",
"blanchedalmond":"#ffebcd",
"blueviolet":"#8a2be2",
"burlywood":"#deb887",
"cadetblue":"#5f9ea0",
"chartreuse":"#7fff00",
"chocolate":"#d2691e",
"coral":"#ff7f50",
"cornflowerblue":"#6495ed",
"cornsilk":"#fff8dc",
"crimson":"#dc143c",
"cyan":"#00ffff",
"darkblue":"#00008b",
"darkcyan":"#008b8b",
"darkgoldenrod":"#b8860b",
"darkgray":"#a9a9a9",
"darkgreen":"#006400",
"darkkhaki":"#bdb76b",
"darkmagenta":"#8b008b",
"darkolivegreen":"#556b2f",
"darkorange":"#ff8c00",
"darkorchid":"#9932cc",
"darkred":"#8b0000",
"darksalmon":"#e9967a",
"darkseagreen":"#8fbc8f",
"darkslateblue":"#483d8b",
"darkslategray":"#2f4f4f",
"darkturquoise":"#00ced1",
"darkviolet":"#9400d3",
"deeppink":"#ff1493",
"deepskyblue":"#00bfff",
"dimgray":"#696969",
"dodgerblue":"#1e90ff",
"firebrick":"#b22222",
"floralwhite":"#fffaf0",
"forestgreen":"#228b22",
"fuchsia":"#ff00ff",
"gainsboro":"#dcdcdc",
"ghostwhite":"#f8f8ff",
"goldenrod":"#daa520",
"green":"#008800",
"greenyellow":"#adff2f",
"honeydew":"#f0fff0",
"hotpink":"#ff69b4",
"indianred ":"#cd5c5c",
"indigo ":"#4b0082",
"lavender":"#e6e6fa",
"lavenderblush":"#fff0f5",
"lawngreen":"#7cfc00",
"lemonchiffon":"#fffacd",
"lightblue":"#add8e6",
"lightcoral":"#f08080",
"lightcyan":"#e0ffff",
"lightgoldenrodyellow":"#fafad2",
"lightgrey":"#d3d3d3",
"lightgreen":"#90ee90",
"lightpink":"#ffb6c1",
"lightsalmon":"#ffa07a",
"lightseagreen":"#20b2aa",
"lightskyblue":"#87cefa",
"lightslategray":"#778899",
"lightsteelblue":"#b0c4de",
"lightyellow":"#ffffe0",
"lime":"#00ff00",
"limegreen":"#32cd32",
"magenta":"#ff00ff",
"maroon":"#800000",
"mediumaquamarine":"#66cdaa",
"mediumblue":"#0000cd",
"mediumorchid":"#ba55d3",
"mediumpurple":"#9370d8",
"mediumseagreen":"#3cb371",
"mediumslateblue":"#7b68ee",
"mediumspringgreen":"#00fa9a",
"mediumturquoise":"#48d1cc",
"mediumvioletred":"#c71585",
"midnightblue":"#191970",
"mintcream":"#f5fffa",
"mistyrose":"#ffe4e1",
"moccasin":"#ffe4b5",
"navajowhite":"#ffdead",
"oldlace":"#fdf5e6",
"olivedrab":"#6b8e23",
"orange":"#ffa500",
"orangered":"#ff4500",
"orchid":"#da70d6",
"palegoldenrod":"#eee8aa",
"palegreen":"#98fb98",
"paleturquoise":"#afeeee",
"palevioletred":"#d87093",
"papayawhip":"#ffefd5",
"peachpuff":"#ffdab9",
"powderblue":"#b0e0e6",
"purple":"#800080",
"rosybrown":"#bc8f8f",
"royalblue":"#4169e1",
"saddlebrown":"#8b4513",
"salmon":"#fa8072",
"sandybrown":"#f4a460",
"seagreen":"#2e8b57",
"seashell":"#fff5ee",
"sienna":"#a0522d",
"silver":"#c0c0c0",
"skyblue":"#87ceeb",
"slateblue":"#6a5acd",
"slategray":"#708090",
"springgreen":"#00ff7f",
"steelblue":"#4682b4",
"thistle":"#d8bfd8",
"tomato":"#ff6347",
"turquoise":"#40e0d0",
"violet":"#ee82ee",
"white":"#ffffff",
"whitesmoke":"#f5f5f5",
"yellow":"#ffff00",
"yellowgreen":"#9acd32"
}

View File

@@ -1,218 +0,0 @@
<?php
/**
* CSS Compressor [VERSION]
* [DATE]
* Corey Hart @ http://www.codenothing.com
*/
Class CSSCompression_Cleanup
{
/**
* Cleanup patterns
*
* @class Control: Compression Controller
* @param (string) token: Copy of the injection token
* @param (regex) rtoken: Token regex built upon instantiation
* @param (array) options: Reference to options
* @param (regex) rsemi: Checks for last semit colon in details
* @param (regex) rsemicolon: Checks for semicolon without an escape '\' character before it
* @param (regex) rspace: Checks for space without an escape '\' character before it
* @param (regex) rcolon: Checks for colon without an escape '\' character before it
* @param (regex) rquote: Checks for quote (') without an escape '\' character before it
* @param (array) rescape: Array of patterns for groupings that should be escaped
* @param (array) escaped: Contains patterns and replacements for espaced characters
*/
private $Control;
private $token = '';
private $rtoken = '';
private $options = array();
private $rsemi = "/;$/";
private $rsemicolon = "/(?<!\\\);/";
private $rspace = "/(?<!\\\)\s/";
private $rcolon = "/(?<!\\\):/";
private $rquote = "/(?<!\\\)'/";
private $rescape = array(
"/((?<!\\\)\")(.*?)((?<!\\\)\")/",
"/((?<!\\\)')(.*?)((?<!\\\)')/",
"/(url\()(.*?)(\))/",
);
private $escaped = array(
'search' => array(
"\\:",
"\\;",
"\\}",
"\\{",
"\\@",
"\\!",
"\\,",
"\\>",
"\\+",
"\\~",
"\\/",
"\\*",
"\\.",
"\\=",
"\\#",
"\\r",
"\\n",
"\\t",
"\\ ",
),
'replace' => array(
":",
";",
"}",
"{",
"@",
"!",
",",
">",
"+",
"~",
"/",
"*",
".",
"=",
"#",
"\r",
"\n",
"\t",
" ",
),
);
/**
* Build the token regex based on defined token
*
* @param (class) control: CSSCompression Controller
*/
public function __construct( CSSCompression_Control $control ) {
$this->Control = $control;
$this->token = CSSCompression::TOKEN;
$this->options = &$control->Option->options;
// Have to build the token regexs after initialization
$this->rtoken = "/($this->token)(.*?)($this->token)/";
array_push( $this->rescape, $this->rtoken );
}
/**
* Central cleanup process, removes all injections
*
* @param (array) selectors: Array of selectors
* @param (array) details: Array of details
*/
public function cleanup( &$selectors, &$details ) {
foreach ( $details as $i => &$value ) {
// Auto skip sections
if ( isset( $selectors[ $i ] ) && strpos( $selectors[ $i ], $this->token ) === 0 ) {
continue;
}
// Removing dupes
if ( $this->options['rm-multi-define'] ) {
$value = $this->removeMultipleDefinitions( $value );
}
$value = $this->removeUnnecessarySemicolon( $value );
}
return array( $selectors, $details );
}
/**
* Removes '\' from possible splitter characters in URLs
*
* @param (string) css: Full css sheet
*/
public function removeInjections( $css ) {
// Remove escaped characters
foreach ( $this->rescape as $regex ) {
$pos = 0;
while ( preg_match( $regex, $css, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
$value = $match[ 1 ][ 0 ]
. str_replace( $this->escaped['search'], $this->escaped['replace'], $match[ 2 ][ 0 ] )
. $match[ 3 ][ 0 ];
$css = substr_replace( $css, $value, $match[ 0 ][ 1 ], strlen( $match[ 0 ][ 0 ] ) );
$pos = $match[ 0 ][ 1 ] + strlen( $value ) + 1;
}
}
// Remove token injections
$pos = 0;
while ( preg_match( $this->rtoken, $css, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
$value = $match[ 2 ][ 0 ];
if ( preg_match( $this->rspace, $value ) ) {
$quote = preg_match( $this->rquote, $value ) ? "\"" : "'";
$value = "$quote$value$quote";
$css = substr_replace( $css, $value, $match[ 0 ][ 1 ], strlen( $match[ 0 ][ 0 ] ) );
$pos = $match[ 0 ][ 1 ] + strlen( $value ) + 1;
}
else {
$css = substr_replace( $css, $value, $match[ 0 ][ 1 ], strlen( $match[ 0 ][ 0 ] ) );
$pos = $match[ 0 ][ 1 ] + strlen( $value ) + 1;
}
}
return $css;
}
/**
* Removes multiple definitions that were created during compression
*
* @param (string) val: CSS Selector Properties
*/
private function removeMultipleDefinitions( $val = '' ) {
$storage = array();
$arr = preg_split( $this->rsemicolon, $val );
foreach ( $arr as $x ) {
if ( $x ) {
list( $a, $b ) = preg_split( $this->rcolon, $x, 2 );
$storage[ $a ] = $b;
}
}
if ( $storage ) {
$val = '';
foreach ( $storage as $x => $y ) {
$val .= "$x:$y;";
}
}
// Return converted val
return $val;
}
/**
* Removes last semicolons on the final property of a set
*
* @param (string) value: rule set
*/
private function removeUnnecessarySemicolon( $value ) {
return preg_replace( $this->rsemi, '', $value );
}
/**
* Access to private methods for testing
*
* @param (string) method: Method to be called
* @param (array) args: Array of paramters to be passed in
*/
public function access( $method, $args ) {
if ( method_exists( $this, $method ) ) {
if ( $method == 'cleanup' ) {
return $this->cleanup( $args[ 0 ], $args[ 1 ] );
}
else {
return call_user_func_array( array( $this, $method ), $args );
}
}
else {
throw new CSSCompression_Exception( "Unknown method in Cleanup Class - " . $method );
}
}
};
?>

View File

@@ -1,199 +0,0 @@
<?php
/**
* CSS Compressor [VERSION]
* [DATE]
* Corey Hart @ http://www.codenothing.com
*/
Class CSSCompression_Color
{
/**
* Color Patterns
*
* @class Control: Compression Controller
* @param (array) options: Reference to options array
* @param (regex) rrgb: Checks for rgb notation
* @param (regex) rhex: Checks for hex code
* @param (regex) rfullhex: Checks for full 6 character hex code
* @static (array) color2hex: Long color name to hex code conversions
* @static (array) hex2short: Hex code to short color name conversions
* @static (array) hex2short_safe: CSS Level 1 safe color names that are shorter than hex codes
* @static (array) files: List of static helpers with their class vars
*/
private $Control;
private $options = array();
private $rrgb = "/^rgb\((\d{1,3}\%?(,\d{1,3}\%?,\d{1,3}\%?)?)\)$/i";
private $rhex = "/^#([0-9a-f]{3}|[0-9a-f]{6})$/i";
private $rfullhex = "/^#([0-9a-f]{6})$/i";
private static $color2hex = array();
private static $hex2short = array();
private static $hex2short_safe = array();
private static $files = array(
'color2hex' => 'long2hex-colors.json',
'hex2short' => 'hex2short-colors.json',
'hex2short_safe' => 'hex2short-safe.json',
);
/**
* Stash a reference to the controller on each instantiation
* and install conversion helpers
*
* @param (class) control: CSSCompression Controller
*/
public function __construct( CSSCompression_Control $control ) {
$this->Control = $control;
$this->options = &$control->Option->options;
if ( ! self::$color2hex ) {
foreach ( self::$files as $v => $file ) {
self::$$v = CSSCompression::getJSON( $file );
}
}
}
/**
* Central handler for all color conversions.
*
* @param (string) val: Color to be parsed
*/
public function color( $val ) {
// Converts rgb values to hex codes
if ( $this->options['color-rgb2hex'] ) {
$val = $this->rgb2hex( $val );
}
// Convert long color names to hex codes
if ( $this->options['color-long2hex'] ) {
$val = $this->color2hex( $val );
}
// Ensure all hex codes are lowercase
if ( preg_match( $this->rhex, $val ) ) {
$val = strtolower( $val );
}
// Convert large hex codes to small codes
if ( $this->options['color-hex2shorthex'] ) {
$val = $this->hex2short( $val );
}
// Convert 6 digit hex codes to short color names
if ( $this->options['color-hex2shortcolor'] ) {
$val = $this->hex2color( $val );
}
// Convert safe css level1 color names
if ( $this->options['color-hex2safe'] ) {
$val = $this->hex2safe( $val );
}
return $val;
}
/**
* Converts rgb values to hex codes
*
* @param (string) val: Color to be converted
*/
private function rgb2hex( $val ) {
if ( ! preg_match( $this->rrgb, $val, $match ) ) {
return $val;
}
// locals
$hex = '0123456789abcdef';
$str = explode( ',', $match[ 1 ] );
$new = '';
// Incase rgb was defined with single val
if ( ! $str ) {
$str = array( $match[ 1 ] );
}
foreach ( $str as $x ) {
$x = strpos( $x, '%' ) !== false ? intval( ( intval( $x ) / 100 ) * 255 ) : intval( $x );
if ( $x > 255 ) {
$x = 255;
}
if ( $x < 0 ) {
$x = 0;
}
$new .= $hex[ ( $x - $x % 16 ) / 16 ];
$new .= $hex[ $x % 16 ];
}
// Repeat hex code to complete 6 digit hex requirement for single definitions
if ( count( $str ) == 1 ) {
$new .= $new . $new;
}
// Replace with hex value
return "#$new";
}
/**
* Convert long color names to hex codes
*
* @param (string) val: Color to be converted
*/
private function color2hex( $val ) {
return isset( self::$color2hex[ $val ] ) ? self::$color2hex[ $val ] : $val;
}
/**
* Convert large hex codes to small codes
*
* @param (string) val: Hex to be shortened
*/
private function hex2short( $val ) {
if ( ! preg_match( $this->rfullhex, $val, $match ) ) {
return $val;
}
// See if we can convert to 3 char hex
$hex = $match[ 1 ];
if ( $hex[ 0 ] == $hex[ 1 ] && $hex[ 2 ] == $hex[ 3 ] && $hex[ 4 ] == $hex[ 5 ] ) {
$val = '#' . $hex[ 0 ] . $hex[ 2 ] . $hex[ 4 ];
}
return $val;
}
/**
* Convert large hex codes to small codes
*
* @param (string) val: Color to be converted
*/
private function hex2color( $val ) {
return isset( self::$hex2short[ $val ] ) ? self::$hex2short[ $val ] : $val;
}
/**
* Convert large hex codes to small codes
*
* @param (string) val: Color to be converted
*/
private function hex2safe( $val ) {
return isset( self::$hex2short_safe[ $val ] ) ? self::$hex2short_safe[ $val ] : $val;
}
/**
* Access to private methods for testing
*
* @param (string) method: Method to be called
* @param (array) args: Array of paramters to be passed in
*/
public function access( $method, $args ) {
if ( method_exists( $this, $method ) ) {
return call_user_func_array( array( $this, $method ), $args );
}
else {
throw new CSSCompression_Exception( "Unknown method in Color Class - " . $method );
}
}
};
?>

View File

@@ -1,191 +0,0 @@
<?php
/**
* CSS Compressor [VERSION]
* [DATE]
* Corey Hart @ http://www.codenothing.com
*/
Class CSSCompression_Combine
{
/**
* Combine Patterns
*
* @class Control: Compression Controller
* @param (string) token: Copy of the injection token
* @param (array) options: Reference to options
* @param (regex) rspace: Checks for space without an escape '\' character before it
* @param (regex) rslash: Checks for unescaped slash character
* @param (regex) rimportant: Checking props for uncombinables
* @param (array) methods: List of options with their corresponding class
*/
private $Control;
private $token = '';
private $options = array();
private $rspace = "/(?<!\\\)\s/";
private $rslash = "/(?<!\\\)\//";
private $rimportant = "/inherit|\!important|\!ie|(?<!\\\)\s/i";
private $methods = array(
'csw-combine' => 'BorderOutline',
'border-radius-combine' => 'BorderRadius',
'border-combine' => 'Border',
'mp-combine' => 'MarginPadding',
'background-combine' => 'Background',
'auralcp-combine' => 'Aural',
'font-combine' => 'Font',
'list-combine' => 'List',
);
/**
* Sub Comination Classes
*
* @class BorderOutline: Handles Color/Style/With combinations of border/outline properties
* @class BorderRadius: Handles border-radius combinations
* @class Border: Handles normal border combinations
* @class MarginPadding: Handles margin/padding combinations
* @class Background: Handles background combinations
* @class Aural: Handles aural combinations
* @class Font: Handles font combinations
* @class List: Handles list combinations
* @param (array) subcombines: Array holding all subcombination classes
*/
public $BorderOutline;
public $BorderRadius;
public $Border;
public $MarginPadding;
public $Background;
public $Aural;
public $Font;
public $List;
private $subcombines = array(
'BorderOutline',
'BorderRadius',
'Border',
'MarginPadding',
'Background',
'Aural',
'Font',
'List',
);
/**
* Stash a reference to the controller on each instantiation
*
* @param (class) control: CSSCompression Controller
*/
public function __construct( CSSCompression_Control $control ) {
$this->Control = $control;
$this->token = CSSCompression::TOKEN;
$this->options = &$control->Option->options;
// Include classes if not already done so
if ( ! class_exists( "CSSCompression_Combine_Border", false ) ) {
$path = dirname(__FILE__) . '/Combine/';
foreach ( $this->subcombines as $class ) {
require( $path . $class . '.php' );
}
}
// Instantiate each sub combine
foreach ( $this->subcombines as $class ) {
$full = "CSSCompression_Combine_$class";
$this->$class = new $full( $control, $this );
}
}
/**
* Reads through each detailed package and checks for cross defn combinations
*
* @param (array) selectors: Array of selectors
* @param (array) details: Array of details
*/
public function combine( &$selectors = array(), &$details = array() ) {
foreach ( $details as $i => &$value ) {
if ( isset( $selectors[ $i ] ) && strpos( $selectors[ $i ], $this->token ) === 0 ) {
continue;
}
foreach ( $this->methods as $option => $class ) {
if ( $this->options[ $option ] ) {
$value = $this->$class->combine( $value );
}
}
}
return array( $selectors, $details );
}
/**
* Helper function to ensure flagged words don't get
* overridden
*
* @param (mixed) obj: Array/String of definitions to be checked
*/
public function checkUncombinables( $obj ) {
if ( is_array( $obj ) ) {
foreach ( $obj as $item ) {
if ( preg_match( $this->rimportant, $item ) ) {
return true;
}
}
return false;
}
else {
return preg_match( $this->rimportant, $obj );
}
}
/**
* Helper function to ensure all values of search array
* exist within the storage array
*
* @param (string) prop: CSS Property
* @param (array) storage: Array of definitions found
* @param (array) search: Array of definitions requred
*/
public function searchDefinitions( $prop, $storage, $search ) {
// Return if storage & search don't match
if ( count( $storage ) != count( $search ) ) {
return false;
}
$str = "$prop:";
foreach ( $search as $value ) {
if ( ! isset( $storage[ $value ] ) || $this->checkUncombinables( $storage[ $value ] ) ) {
return false;
}
$str .= $storage[ $value ] . ' ';
}
return trim( $str ) . ';';
}
/**
* Access to private methods for testing
*
* @param (string) subclass: Name of subclass to focus on
* @param (string) method: Method to be called
* @param (array) args: Array of paramters to be passed in
*/
public function access( $subclass, $method, $args ) {
if ( $subclass == 'Combine' ) {
if ( method_exists( $this, $method ) ) {
if ( $method == 'combine' ) {
return $this->combine( $args[ 0 ], $args[ 1 ] );
}
else {
return call_user_func_array( array( $this, $method ), $args );
}
}
else {
throw new CSSCompression_Exception( "Unknown method in Combine Class - " . $method );
}
}
else if ( in_array( $subclass, $this->subcombines ) ) {
return $this->$subclass->access( $method, $args );
}
else {
throw new CSSCompression_Exception( "Unknown Sub Combine Class - " . $subclass );
}
}
};
?>

View File

@@ -1,109 +0,0 @@
<?php
/**
* CSS Compressor [VERSION]
* [DATE]
* Corey Hart @ http://www.codenothing.com
*/
Class CSSCompression_Combine_Aural
{
/**
* Combine Patterns
*
* @class Control: Compression Controller
* @class Combine: Combine Controller
* @param (regex) raural: Aurual matching
*/
private $Control;
private $Combine;
private $raural = "/(^|(?<!\\\);)(cue|pause)-(before|after):(.*?)((?<!\\\);|$)/";
/**
* Stash a reference to the controller & combiner
*
* @param (class) control: CSSCompression Controller
* @param (class) combine: CSSCompression Combiner
*/
public function __construct( CSSCompression_Control $control, CSSCompression_Combine $combine ) {
$this->Control = $control;
$this->Combine = $combine;
}
/**
* Combines Aural properties (currently being depreciated in W3C Standards)
*
* @param (string) val: Rule Set
*/
public function combine( $val ) {
$storage = $this->storage( $val );
$pos = 0;
// Replace first occurance with it's prop, and remove all following occurances
while ( preg_match( $this->raural, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
$prop = $match[ 2 ][ 0 ];
if ( isset( $storage[ $prop ] ) ) {
$colon = strlen( $match[ 1 ][ 0 ] );
$val = substr_replace( $val, $storage[ $prop ], $match[ 0 ][ 1 ] + $colon, strlen( $match[ 0 ][ 0 ] ) - $colon );
$pos = $match[ 0 ][ 1 ] + strlen( $storage[ $prop ] ) - $colon - 1;
$storage[ $prop ] = '';
}
else {
$pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] ) - 1;
}
}
// Return converted val
return $val;
}
/**
* Builds a storage object for iteration
*
* @param (string) val: Rule Set
*/
private function storage( $val ) {
$storage = array();
// Find all possible occurences and build the replacement
$pos = 0;
while ( preg_match( $this->raural, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
if ( ! isset( $storage[ $match[ 2 ][ 0 ] ] ) ) {
$storage[ $match[ 2 ][ 0 ] ] = array( $match[ 3 ][ 0 ] => $match[ 4 ][ 0 ] );
}
// Override double written properties
$storage[ $match[ 2 ][ 0 ] ][ $match[ 3 ][ 0 ] ] = $match[ 4 ][ 0 ];
$pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] ) - 1;
}
// Go through each tag for possible combination
foreach ( $storage as $tag => $arr ) {
// All three have to be defined
if ( count( $arr ) == 2 && ! $this->Combine->checkUncombinables( $arr ) ) {
$storage[ $tag ] = "$tag:" . $arr['before'] . ' ' . $arr['after'] . ';';
}
else {
unset( $storage[ $tag ] );
}
}
return $storage;
}
/**
* Access to private methods for testing
*
* @param (string) method: Method to be called
* @param (array) args: Array of paramters to be passed in
*/
public function access( $method, $args ) {
if ( method_exists( $this, $method ) ) {
return call_user_func_array( array( $this, $method ), $args );
}
else {
throw new CSSCompression_Exception( "Unknown method in Aural Class - " . $method );
}
}
};
?>

View File

@@ -1,107 +0,0 @@
<?php
/**
* CSS Compressor [VERSION]
* [DATE]
* Corey Hart @ http://www.codenothing.com
*/
Class CSSCompression_Combine_Background
{
/**
* Combine Patterns
*
* @class Control: Compression Controller
* @class Combine: Combine Controller
* @param (regex) rbackground: Background matching
* @param (array) groupings: List of background combinations
*/
private $Control;
private $Combine;
private $rbackground = "/(^|(?<!\\\);)background-(color|image|repeat|attachment|position):(.*?)((?<!\\\);|$)/";
private $groupings = array(
// With color
array( 'color', 'image', 'repeat', 'attachment', 'position' ),
array( 'color', 'image', 'attachment', 'position' ),
array( 'color', 'image', 'repeat', 'position' ),
array( 'color', 'image', 'repeat', 'attachment' ),
array( 'color', 'image', 'repeat' ),
array( 'color', 'image', 'attachment' ),
array( 'color', 'image', 'position' ),
array( 'color', 'image' ),
// Without Color
array( 'image', 'attachment', 'position' ),
array( 'image', 'repeat', 'position' ),
array( 'image', 'repeat', 'attachment' ),
array( 'image', 'repeat' ),
array( 'image', 'attachment' ),
array( 'image', 'position' ),
// Just Color/Image
array( 'image' ),
array( 'color' ),
);
/**
* Stash a reference to the controller & combiner
*
* @param (class) control: CSSCompression Controller
* @param (class) combine: CSSCompression Combiner
*/
public function __construct( CSSCompression_Control $control, CSSCompression_Combine $combine ) {
$this->Control = $control;
$this->Combine = $combine;
}
/**
* Combines multiple background props into single definition
*
* @param (string) val: Rule Set
*/
public function combine( $val ) {
$storage = array();
// Find all possible occurences and build the replacement
$pos = 0;
while ( preg_match( $this->rbackground, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
$storage[ $match[ 2 ][ 0 ] ] = $match[ 3 ][ 0 ];
$pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] ) - 1;
}
// Run background checks and get replacement str
foreach ( $this->groupings as $props ) {
if ( $replace = $this->Combine->searchDefinitions( 'background', $storage, $props ) ) {
break;
}
}
// If replacement string found, run it on all declarations
if ( $replace ) {
$pos = 0;
while ( preg_match( $this->rbackground, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
$colon = strlen( $match[ 1 ][ 0 ] );
$val = substr_replace( $val, $replace, $match[ 0 ][ 1 ] + $colon, strlen( $match[ 0 ][ 0 ] ) - $colon );
$pos = $match[ 0 ][ 1 ] + strlen( $replace ) - $colon - 1;
$replace = '';
}
}
// Return converted val
return $val;
}
/**
* Access to private methods for testing
*
* @param (string) method: Method to be called
* @param (array) args: Array of paramters to be passed in
*/
public function access( $method, $args ) {
if ( method_exists( $this, $method ) ) {
return call_user_func_array( array( $this, $method ), $args );
}
else {
throw new CSSCompression_Exception( "Unknown method in Background Class - " . $method );
}
}
};
?>

View File

@@ -1,98 +0,0 @@
<?php
/**
* CSS Compressor [VERSION]
* [DATE]
* Corey Hart @ http://www.codenothing.com
*/
Class CSSCompression_Combine_Border
{
/**
* Combine Patterns
*
* @class Control: Compression Controller
* @class Combine: Combine Controller
* @param (regex) rborder: Border matching
*/
private $Control;
private $Combine;
private $rborder = "/(^|(?<!\\\);)border-(top|right|bottom|left):(.*?)((?<!\\\);|$)/";
/**
* Stash a reference to the controller & combiner
*
* @param (class) control: CSSCompression Controller
* @param (class) combine: CSSCompression Combiner
*/
public function __construct( CSSCompression_Control $control, CSSCompression_Combine $combine ) {
$this->Control = $control;
$this->Combine = $combine;
}
/**
* Combines multiple border properties into single definition
*
* @param (string) val: Rule Set
*/
public function combine( $val ) {
if ( ( $replace = $this->replace( $val ) ) === false ) {
return $val;
}
// Rebuild the rule set with the combinations found
$pos = 0;
while ( preg_match( $this->rborder, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
$colon = strlen( $match[ 1 ][ 0 ] );
$val = substr_replace( $val, $replace, $match[ 0 ][ 1 ] + $colon, strlen( $match[ 0 ][ 0 ] ) - $colon );
$pos = $match[ 0 ][ 1 ] + strlen( $replace ) - $colon - 1;
$replace = '';
}
// Return converted val
return $val;
}
/**
* Builds a replacement string
*
* @param (string) val: Rule Set
*/
private function replace( $val ) {
$storage = array();
// Find all possible occurences and build the replacement
$pos = 0;
while ( preg_match( $this->rborder, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
// Override double written properties
$storage[ $match[ 2 ][ 0 ] ] = $match[ 3 ][ 0 ];
$pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] ) - 1;
}
// All 4 have to be defined
if ( count( $storage ) == 4 &&
$storage['top'] == $storage['bottom'] &&
$storage['left'] == $storage['right'] &&
$storage['top'] == $storage['right'] ) {
return "border:" . $storage['top'] . ';';
}
return false;
}
/**
* Access to private methods for testing
*
* @param (string) method: Method to be called
* @param (array) args: Array of paramters to be passed in
*/
public function access( $method, $args ) {
if ( method_exists( $this, $method ) ) {
return call_user_func_array( array( $this, $method ), $args );
}
else {
throw new CSSCompression_Exception( "Unknown method in Border Class - " . $method );
}
}
};
?>

View File

@@ -1,109 +0,0 @@
<?php
/**
* CSS Compressor [VERSION]
* [DATE]
* Corey Hart @ http://www.codenothing.com
*/
Class CSSCompression_Combine_BorderOutline
{
/**
* Combine Patterns
*
* @class Control: Compression Controller
* @class Combine: Combine Controller
* @param (regex) rcsw: Border/Outline matching
*/
private $Control;
private $Combine;
private $rcsw = "/(^|(?<!\\\);)(border|border-top|border-bottom|border-left|border-right|outline)-(color|style|width):(.*?)((?<!\\\);|$)/";
/**
* Stash a reference to the controller & combiner
*
* @param (class) control: CSSCompression Controller
* @param (class) combine: CSSCompression Combiner
*/
public function __construct( CSSCompression_Control $control, CSSCompression_Combine $combine ) {
$this->Control = $control;
$this->Combine = $combine;
}
/**
* Combines color/style/width of border/outline properties
*
* @param (string) val: Rule Set
*/
public function combine( $val ) {
$storage = $this->storage( $val );
$pos = 0;
// Now rebuild the string replacing all instances
while ( preg_match( $this->rcsw, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
$prop = $match[ 2 ][ 0 ];
if ( isset( $storage[ $prop ] ) ) {
$colon = strlen( $match[ 1 ][ 0 ] );
$val = substr_replace( $val, $storage[ $prop ], $match[ 0 ][ 1 ] + $colon, strlen( $match[ 0 ][ 0 ] ) - $colon );
$pos = $match[ 0 ][ 1 ] + strlen( $storage[ $prop ] ) - $colon - 1;
$storage[ $prop ] = '';
}
else {
$pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] ) - 1;
}
}
// Return converted val
return $val;
}
/**
* Builds a storage object for iteration
*
* @param (string) val: Rule Set
*/
private function storage( $val ) {
$storage = array();
$pos = 0;
// Find all possible occurences and build the replacement
while ( preg_match( $this->rcsw, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
if ( ! isset( $storage[ $match[ 2 ][ 0 ] ] ) ) {
$storage[ $match[ 2 ][ 0 ] ] = array( $match[ 3 ][ 0 ] => $match[ 4 ][ 0 ] );
}
// Override double written properties
$storage[ $match[ 2 ][ 0 ] ][ $match[ 3 ][ 0 ] ] = $match[ 4 ][ 0 ];
$pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] ) - 1;
}
// Go through each tag for possible combination
foreach ( $storage as $tag => $arr ) {
// All three have to be defined
if ( count( $arr ) == 3 && ! $this->Combine->checkUncombinables( $arr ) ) {
$storage[ $tag ] = "$tag:" . $arr['width'] . ' ' . $arr['style'] . ' ' . $arr['color'] . ';';
}
else {
unset( $storage[ $tag ] );
}
}
return $storage;
}
/**
* Access to private methods for testing
*
* @param (string) method: Method to be called
* @param (array) args: Array of paramters to be passed in
*/
public function access( $method, $args ) {
if ( method_exists( $this, $method ) ) {
return call_user_func_array( array( $this, $method ), $args );
}
else {
throw new CSSCompression_Exception( "Unknown method in BorderOutline Class - " . $method );
}
}
};
?>

View File

@@ -1,263 +0,0 @@
<?php
/**
* CSS Compressor [VERSION]
* [DATE]
* Corey Hart @ http://www.codenothing.com
*/
Class CSSCompression_Combine_BorderRadius
{
/**
* Combine Patterns
*
* @class Control: Compression Controller
* @class Combine: Combine Controller
* @param (regex) rspace: Checks for space without an escape '\' character before it
* @param (regex) rslash: Checks for unescaped slash character
* @param (array) borderRadius: Various border radii components
*/
private $Control;
private $Combine;
private $rspace = "/(?<!\\\)\s/";
private $rslash = "/(?<!\\\)\//";
private $borderRadius = array(
'css3' => array(
'mod' => '',
'base' => "/(^|(?<!\\\);)border-radius:(.*?)((?<!\\\);|$)/",
'full' => "/(^|(?<!\\\);)border-(top|bottom)-(left|right)-radius:(.*?)((?<!\\\);|$)/",
),
'moz' => array(
'mod' => '-moz-',
'base' => "/(^|(?<!\\\);)-moz-border-radius:(.*?)((?<!\\\);|$)/",
'full' => "/(^|(?<!\\\);)-moz-border-radius-(top|bottom)(left|right):(.*?)((?<!\\\);|$)/"
),
'webkit' => array(
'mod' => '-webkit-',
'base' => "/(^|(?<!\\\);)-webkit-border-radius:(.*?)((?<!\\\);|$)/",
'full' => "/(^|(?<!\\\);)-webkit-border-(top|bottom)-(left|right)-radius:(.*?)((?<!\\\);|$)/"
),
);
/**
* Stash a reference to the controller & combiner
*
* @param (class) control: CSSCompression Controller
* @param (class) combine: CSSCompression Combiner
*/
public function __construct( CSSCompression_Control $control, CSSCompression_Combine $combine ) {
$this->Control = $control;
$this->Combine = $combine;
}
/**
* Main handler to combine border-radii into a single rule
*
* @param (string) val: Rule Set
*/
public function combine( $val ) {
foreach ( $this->borderRadius as $regex ) {
$val = $this->fix( $val, $regex );
}
return $val;
}
/**
* Does the actual combining
*
* @param (string) val: Rule Set
*/
private function fix( $val, $regex ) {
$val = $this->base( $val, $regex );
$replace = $regex['mod'];
// Storage builder
if ( ( $storage = $this->storage( $val, $regex ) ) === false ) {
return $val;
}
// Setup horizontal/vertical radii
foreach ( $storage as $dir => &$config ) {
// Verticals are optional
if ( $dir == 'vertical' && ! $config['keep'] ) {
break;
}
// All 4 are the same
else if ( $config['top-left'] == $config['top-right'] &&
$config['top-right'] == $config['bottom-right'] &&
$config['bottom-right'] == $config['bottom-left'] ) {
$config['replace'] .= $config['top-left'];
}
// Opposites are the same
else if ( $config['top-left'] == $config['bottom-right'] && $config['top-right'] == $config['bottom-left'] ) {
$config['replace'] .= $config['top-left'] . ' ' . $config['top-right'];
}
// 3-point directional
else if ( $config['top-right'] == $config['bottom-left'] ) {
$config['replace'] .= $config['top-left'] . ' ' . $config['top-right'] . ' ' . $config['bottom-right'];
}
// none are the same, but can still use shorthand notation
else {
$config['replace'] .= $config['top-left'] . ' ' . $config['top-right'] . ' '
. $config['bottom-right'] . ' ' . $config['bottom-left'];
}
}
// Now rebuild the string replacing all instances of margin/padding if shorthand exists
$pos = 0;
$replace = $regex['mod'] . "border-radius:" . $storage['horizontal']['replace'] . $storage['vertical']['replace'] . ';';
while ( preg_match( $regex['full'], $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
$colon = strlen( $match[ 1 ][ 0 ] );
$val = substr_replace( $val, $replace, $match[ 0 ][ 1 ] + $colon, strlen( $match[ 0 ][ 0 ] ) - $colon );
$pos = $match[ 0 ][ 1 ] + strlen( $replace ) - $colon - 1;
$replace = '';
}
// Return converted val
return $val;
}
/**
* Expands short handed border radius props for combination
*
* @param (string) val: Rule Set
*/
private function base( $val, $regex ) {
$pos = 0;
while ( preg_match( $regex['base'], $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
$replace = '';
$colon = strlen( $match[ 1 ][ 0 ] );
$parts = preg_split( $this->rslash, trim( $match[ 2 ][ 0 ] ), 2 );
$positions = array(
'top-left' => 0,
'top-right' => 0,
'bottom-right' => 0,
'bottom-left' => 0,
);
$base = array(
'horizontal' => array(
'parts' => preg_split( $this->rspace, trim( $parts[ 0 ] ) ),
'pos' => $positions,
),
'vertical' => array(
'parts' => isset( $parts[ 1 ] ) ? preg_split( $this->rspace, trim( $parts[ 1 ] ) ) : '',
'pos' => $positions,
),
);
foreach ( $base as &$config ) {
// Skip uncombinables
if ( $this->Combine->checkUncombinables( $config['parts'] ) ) {
$pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] ) - 1;
continue 2;
}
// Might not have verticals
else if ( $config['parts'] === '' ) {
continue;
}
// Each position needs a value
switch ( count( $config['parts'] ) ) {
case 1:
$config['pos']['top-left'] = $config['pos']['top-right'] = $config['parts'][ 0 ];
$config['pos']['bottom-left'] = $config['pos']['bottom-right'] = $config['parts'][ 0 ];
break;
case 2:
$config['pos']['top-left'] = $config['pos']['bottom-right'] = $config['parts'][ 0 ];
$config['pos']['bottom-left'] = $config['pos']['top-right'] = $config['parts'][ 1 ];
break;
case 3:
$config['pos']['top-left'] = $config['parts'][ 0 ];
$config['pos']['bottom-left'] = $config['pos']['top-right'] = $config['parts'][ 1 ];
$config['pos']['bottom-right'] = $config['parts'][ 2 ];
break;
case 4:
$config['pos']['top-left'] = $config['parts'][ 0 ];
$config['pos']['top-right'] = $config['parts'][ 1 ];
$config['pos']['bottom-right'] = $config['parts'][ 2 ];
$config['pos']['bottom-left'] = $config['parts'][ 3 ];
break;
default:
continue 2;
}
}
// Build the replacement
foreach ( $positions as $p => $v ) {
if ( $regex['mod'] == '-moz-' ) {
$replace .= "-moz-border-radius-" . preg_replace( "/-/", '', $p ) . ":"
. $base['horizontal']['pos'][ $p ]
. ( $base['vertical']['parts'] === '' ? '' : ' ' . $base['vertical']['pos'][ $p ] )
. ';';
}
else {
$replace .= $regex['mod'] . "border-$p-radius:"
. $base['horizontal']['pos'][ $p ]
. ( $base['vertical']['parts'] === '' ? '' : ' ' . $base['vertical']['pos'][ $p ] )
. ';';
}
}
$pos += strlen( $replace );
$val = substr_replace( $val, $replace, $match[ 0 ][ 1 ] + $colon, strlen( $match[ 0 ][ 0 ] ) - $colon );
}
return $val;
}
/**
* Builds the storage object for border radius props
*
* @param (string) val: Rule Set
* @param (array) regex: Current border radius type checking props
*/
private function storage( $val, $regex ) {
$storage = array(
'horizontal' => array( 'replace' => '' ),
'vertical' => array( 'replace' => '', 'keep' => false ),
);
// Find all possible occurences of this border-radius type and mark their directional value
$pos = 0;
while ( preg_match( $regex['full'], $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
$pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] ) - 1;
$parts = preg_split( $this->rspace, $match[ 4 ][ 0 ], 2 );
$storage['horizontal'][ $match[ 2 ][ 0 ] . '-' . $match[ 3 ][ 0 ] ] = trim( $parts[ 0 ] );
if ( isset( $parts[ 1 ] ) ) {
$storage['vertical'][ $match[ 2 ][ 0 ] . '-' . $match[ 3 ][ 0 ] ] = trim( $parts[ 1 ] );
$storage['vertical']['keep'] = true;
$storage['vertical']['replace'] = '/';
}
else {
$storage['vertical'][ $match[ 2 ][ 0 ] . '-' . $match[ 3 ][ 0 ] ] = '0';
}
}
// Only combine if all 4 definitions are found (5 including replace)
if ( count( $storage['horizontal'] ) != 5 ||
$this->Combine->checkUncombinables( $storage['horizontal'] ) ||
$this->Combine->checkUncombinables( $storage['vertical'] ) ) {
return false;
}
return $storage;
}
/**
* Access to private methods for testing
*
* @param (string) method: Method to be called
* @param (array) args: Array of paramters to be passed in
*/
public function access( $method, $args ) {
if ( method_exists( $this, $method ) ) {
return call_user_func_array( array( $this, $method ), $args );
}
else {
throw new CSSCompression_Exception( "Unknown method in BorderRadius Class - " . $method );
}
}
};
?>

View File

@@ -1,125 +0,0 @@
<?php
/**
* CSS Compressor [VERSION]
* [DATE]
* Corey Hart @ http://www.codenothing.com
*/
Class CSSCompression_Combine_Font
{
/**
* Combine Patterns
*
* @class Control: Compression Controller
* @class Combine: Combine Controller
* @param (regex) rfont: Font matching
* @param (array) groupings: Set of font combinationals
*/
private $Control;
private $Combine;
private $rfont = "/(^|(?<!\\\);)(font|line)-(style|variant|weight|size|height|family):(.*?)((?<!\\\);|$)/";
private $groupings = array(
array( 'font-style', 'font-variant', 'font-weight', 'size/height', 'font-family' ),
array( 'font-style', 'font-variant', 'font-weight', 'font-size', 'font-family' ),
array( 'font-style', 'font-variant', 'size/height', 'font-family' ),
array( 'font-style', 'font-variant', 'font-size', 'font-family' ),
array( 'font-style', 'font-weight', 'size/height', 'font-family' ),
array( 'font-style', 'font-weight', 'font-size', 'font-family' ),
array( 'font-variant', 'font-weight', 'size/height', 'font-family' ),
array( 'font-variant', 'font-weight', 'font-size', 'font-family' ),
array( 'font-weight', 'size/height', 'font-family' ),
array( 'font-weight', 'font-size', 'font-family' ),
array( 'font-variant', 'size/height', 'font-family' ),
array( 'font-variant', 'font-size', 'font-family' ),
array( 'font-style', 'size/height', 'font-family' ),
array( 'font-style', 'font-size', 'font-family' ),
array( 'size/height', 'font-family' ),
array( 'font-size', 'font-family' ),
);
/**
* Stash a reference to the controller & combiner
*
* @param (class) control: CSSCompression Controller
* @param (class) combine: CSSCompression Combiner
*/
public function __construct( CSSCompression_Control $control, CSSCompression_Combine $combine ) {
$this->Control = $control;
$this->Combine = $combine;
}
/**
* Combines multiple font-definitions into single definition
*
* @param (string) val: Rule Set
*/
public function combine( $val ) {
$storage = $this->storage( $val );
// Loop through each property check and see if they can be replaced
foreach ( $this->groupings as $props ) {
if ( $replace = $this->Combine->searchDefinitions( 'font', $storage, $props ) ) {
break;
}
}
// If replacement string found, run it on all declarations
if ( $replace ) {
$pos = 0;
while ( preg_match( $this->rfont, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
if ( ! isset( $storage['line-height'] ) && stripos( $match[ 0 ][ 0 ], 'line-height') === 0 ) {
$pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] ) - 1;
continue;
}
$colon = strlen( $match[ 1 ][ 0 ] );
$val = substr_replace( $val, $replace, $match[ 0 ][ 1 ] + $colon, strlen( $match[ 0 ][ 0 ] ) - $colon );
$pos = $match[ 0 ][ 1 ] + strlen( $replace ) - $colon - 1;
$replace = '';
}
}
// Return converted val
return $val;
}
/**
* Builds a storage object for iteration
*
* @param (string) val: Rule Set
*/
private function storage( $val ) {
$storage = array();
// Find all possible occurences and build the replacement
$pos = 0;
while ( preg_match( $this->rfont, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
$storage[ $match[ 2 ][ 0 ] . '-' . $match[ 3 ][ 0 ] ] = $match[ 4 ][ 0 ];
$pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] ) - 1;
}
// Combine font-size & line-height if possible
if ( isset( $storage['font-size'] ) && isset( $storage['line-height'] ) ) {
$storage['size/height'] = $storage['font-size'] . '/' . $storage['line-height'];
unset( $storage['font-size'], $storage['line-height'] );
}
return $storage;
}
/**
* Access to private methods for testing
*
* @param (string) method: Method to be called
* @param (array) args: Array of paramters to be passed in
*/
public function access( $method, $args ) {
if ( method_exists( $this, $method ) ) {
return call_user_func_array( array( $this, $method ), $args );
}
else {
throw new CSSCompression_Exception( "Unknown method in Font Class - " . $method );
}
}
};
?>

View File

@@ -1,104 +0,0 @@
<?php
/**
* CSS Compressor [VERSION]
* [DATE]
* Corey Hart @ http://www.codenothing.com
*/
Class CSSCompression_Combine_List
{
/**
* Combine Patterns
*
* @class Control: Compression Controller
* @class Combine: Combine Controller
* @param (regex) rlist: List style matching
* @param (array) groupings: Group of list combinationals
*/
private $Control;
private $Combine;
private $rlist = "/(^|(?<!\\\);)list-style-(type|position|image):(.*?)((?<!\\\);|$)/";
private $groupings = array(
array( 'type', 'position', 'image' ),
array( 'type', 'position' ),
array( 'type', 'image' ),
array( 'position', 'image' ),
array( 'type' ),
array( 'position' ),
array( 'image' ),
);
/**
* Stash a reference to the controller & combiner
*
* @param (class) control: CSSCompression Controller
* @param (class) combine: CSSCompression Combiner
*/
public function __construct( CSSCompression_Control $control, CSSCompression_Combine $combine ) {
$this->Control = $control;
$this->Combine = $combine;
}
/**
* Combines multiple list style props into single definition
*
* @param (string) val: Rule Set
*/
public function combine( $val ) {
// If replacement string found, run it on all declarations
if ( ( $replace = $this->replace( $val ) ) !== false ) {
$pos = 0;
while ( preg_match( $this->rlist, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
$colon = strlen( $match[ 1 ][ 0 ] );
$val = substr_replace( $val, $replace, $match[ 0 ][ 1 ] + $colon, strlen( $match[ 0 ][ 0 ] ) - $colon );
$pos = $match[ 0 ][ 1 ] + strlen( $replace ) - $colon - 1;
$replace = '';
}
}
// Return converted val
return $val;
}
/**
* Build the replacement string for list props
*
* @param (string) val: Rule Set
*/
private function replace( $val ) {
$storage = array();
$pos = 0;
// Find all possible occurences and build the replacement
while ( preg_match( $this->rlist, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
$storage[ $match[ 2 ][ 0 ] ] = $match[ 3 ][ 0 ];
$pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] ) - 1;
}
// Run background checks and get replacement str
foreach ( $this->groupings as $props ) {
if ( $replace = $this->Combine->searchDefinitions( 'list-style', $storage, $props ) ) {
return $replace;
}
}
return false;
}
/**
* Access to private methods for testing
*
* @param (string) method: Method to be called
* @param (array) args: Array of paramters to be passed in
*/
public function access( $method, $args ) {
if ( method_exists( $this, $method ) ) {
return call_user_func_array( array( $this, $method ), $args );
}
else {
throw new CSSCompression_Exception( "Unknown method in List Class - " . $method );
}
}
};
?>

View File

@@ -1,190 +0,0 @@
<?php
/**
* CSS Compressor [VERSION]
* [DATE]
* Corey Hart @ http://www.codenothing.com
*/
Class CSSCompression_Combine_MarginPadding
{
/**
* Combine Patterns
*
* @class Control: Compression Controller
* @class Combine: Combine Controller
* @param (regex) rspace: Checks for space without an escape '\' character before it
* @param (regex) rmp: Margin/Padding matching
* @param (regex) rmpbase: Margin/Padding base match
*/
private $Control;
private $Combine;
private $rspace = "/(?<!\\\)\s/";
private $rmp = "/(^|(?<!\\\);)(margin|padding)-(top|right|bottom|left):(.*?)((?<!\\\);|$)/";
private $rmpbase = "/(^|(?<!\\\);)(margin|padding):(.*?)((?<!\\\);|$)/";
/**
* Stash a reference to the controller & combiner
*
* @param (class) control: CSSCompression Controller
* @param (class) combine: CSSCompression Combiner
*/
public function __construct( CSSCompression_Control $control, CSSCompression_Combine $combine ) {
$this->Control = $control;
$this->Combine = $combine;
}
/**
* Combines multiple directional properties of
* margin/padding into single definition.
*
* @param (string) val: Rule Set
*/
public function combine( $val ) {
$val = $this->expand( $val );
$storage = $this->storage( $val );
$pos = 0;
// Now rebuild the string replacing all instances of margin/padding if shorthand exists
while ( preg_match( $this->rmp, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
$prop = $match[ 2 ][ 0 ];
if ( isset( $storage[ $prop ] ) ) {
$colon = strlen( $match[ 1 ][ 0 ] );
$val = substr_replace( $val, $storage[ $prop ], $match[ 0 ][ 1 ] + $colon, strlen( $match[ 0 ][ 0 ] ) - $colon );
$pos = $match[ 0 ][ 1 ] + strlen( $storage[ $prop ] ) - $colon - 1;
$storage[ $prop ] = '';
}
else {
$pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] ) - 1;
}
}
// Return converted val
return $val;
}
/**
* Build the storage object for iteration
*
* @param (string) val: Rule Set
*/
private function storage( $val ) {
$storage = array();
$pos = 0;
// Find all possible occurences of margin/padding and mark their directional value
while ( preg_match( $this->rmp, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
if ( ! isset( $storage[ $match[ 2 ][ 0 ] ] ) ) {
$storage[ $match[ 2 ][ 0 ] ] = array( $match[ 3 ][ 0 ] => $match[ 4 ][ 0 ] );
}
// Override double written properties
$storage[ $match[ 2 ][ 0 ] ][ $match[ 3 ][ 0 ] ] = $match[ 4 ][ 0 ];
$pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] ) - 1;
}
// Go through each tag for possible combination
foreach ( $storage as $tag => $arr ) {
// Only combine if all 4 definitions are found
if ( count( $arr ) == 4 && ! $this->Combine->checkUncombinables( $arr ) ) {
// All 4 are the same
if ( $arr['top'] == $arr['bottom'] && $arr['left'] == $arr['right'] && $arr['top'] == $arr['left'] ) {
$storage[ $tag ] = "$tag:" . $arr['top'] . ';';
}
// Opposites are the same
else if ( $arr['top'] == $arr['bottom'] && $arr['left'] == $arr['right'] ) {
$storage[ $tag ] = "$tag:" . $arr['top'] . ' ' . $arr['left'] . ';';
}
// 3-point directional
else if ( $arr['right'] == $arr['left'] ) {
$storage[ $tag ] = "$tag:" . $arr['top'] . ' ' . $arr['right'] . ' ' . $arr['bottom'] . ';';
}
// none are the same, but can still use shorthand notation
else {
$storage[ $tag ] = "$tag:" . $arr['top'] . ' ' . $arr['right'] . ' ' . $arr['bottom'] . ' ' . $arr['left'] . ';';
}
}
else {
unset( $storage[ $tag ] );
}
}
return $storage;
}
/**
* Explodes shorthanded margin/padding properties for later combination
*
* @param (string) val: Rule set
*/
private function expand( $val ) {
$pos = 0;
while ( preg_match( $this->rmpbase, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
$replace = '';
$prop = $match[ 2 ][ 0 ];
$value = preg_split( $this->rspace, trim( $match[ 3 ][ 0 ] ) );
$positions = array(
'top' => 0,
'right' => 0,
'bottom' => 0,
'left' => 0
);
// Skip uncombinables
if ( $this->Combine->checkUncombinables( $value ) ) {
$pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] );
continue;
}
// Each position needs a value
switch ( count( $value ) ) {
case 1:
$positions['top'] = $positions['right'] = $positions['bottom'] = $positions['left'] = $value[ 0 ];
break;
case 2:
$positions['top'] = $positions['bottom'] = $value[ 0 ];
$positions['right'] = $positions['left'] = $value[ 1 ];
break;
case 3:
$positions['top'] = $value[ 0 ];
$positions['right'] = $positions['left'] = $value[ 1 ];
$positions['bottom'] = $value[ 2 ];
break;
case 4:
$positions['top'] = $value[ 0 ];
$positions['right'] = $value[ 1 ];
$positions['bottom'] = $value[ 2 ];
$positions['left'] = $value[ 3 ];
break;
default:
continue;
}
// Build the replacement
foreach ( $positions as $p => $v ) {
$replace .= "$prop-$p:$v;";
}
$colon = strlen( $match[ 1 ][ 0 ] );
$val = substr_replace( $val, $replace, $match[ 0 ][ 1 ] + $colon, strlen( $match[ 0 ][ 0 ] ) - $colon );
$pos = $match[ 0 ][ 1 ] + strlen( $replace ) - $colon - 1;
}
return $val;
}
/**
* Access to private methods for testing
*
* @param (string) method: Method to be called
* @param (array) args: Array of paramters to be passed in
*/
public function access( $method, $args ) {
if ( method_exists( $this, $method ) ) {
return call_user_func_array( array( $this, $method ), $args );
}
else {
throw new CSSCompression_Exception( "Unknown method in MarginPadding Class - " . $method );
}
}
};
?>

View File

@@ -1,212 +0,0 @@
<?php
/**
* CSS Compressor [VERSION]
* [DATE]
* Corey Hart @ http://www.codenothing.com
*/
Class CSSCompression_Compress
{
/**
* Trim Patterns
*
* @param (array) options: Reference to options
* @param (array) stats: Reference to stats
* @param (regex) rsemicolon: Checks for semicolon without an escape '\' character before it
* @param (regex) rcolon: Checks for colon without an escape '\' character before it
* @param (regex) rspace: Checks for space without an escape '\' character before it
*/
private $options = array();
private $stats = array();
private $rsemicolon = "/(?<!\\\);/";
private $rcolon = "/(?<!\\\):/";
private $rspace = "/(?<!\\\)\s/";
/**
* Other inner classes that get used within compression
*
* @class Control: Compression Controller
* @class Trim: Trim Instance
* @class Setup: Setup Instance
* @class Format: Formatting Instance
* @class Combine: Combine Instance
* @class Cleanup: Cleanup Instance
* @class Organize: Organize Instance
* @class Selectors: Selectors Instance
* @param (array) others: List of above classes for copying
*/
private $Control;
private $Trim;
private $Setup;
private $Format;
private $Combine;
private $Cleanup;
private $Organize;
private $Selectors;
private $others = array(
'Trim',
'Setup',
'Format',
'Combine',
'Cleanup',
'Organize',
'Selectors',
);
/**
* Stash a reference to the controller on each instantiation
*
* @param (class) control: CSSCompression Controller
*/
public function __construct( CSSCompression_Control $control ) {
$this->Control = $control;
$this->options = &$control->Option->options;
$this->stats = &$control->stats;
foreach ( $this->others as $class ) {
$this->$class = $control->$class;
}
}
/**
* Centralized function to run css compression.
*
* @param (string) css: Stylesheet to compresss
*/
public function compress( $css ) {
$setup = $this->setup( $css );
$setup = $this->rulesets( $setup );
$css = $this->readability( $setup );
// Attach plea to top of page with unknown blocks
if ( $this->options['add-unknown'] && count( $setup['unknown'] ) ) {
$css = "/*\nThere are unknown blocks in the sheet, please please please open an issue with your sheet attached to it:\n"
. "https://github.com/codenothing/css-compressor/issues\n"
. "Thank You --\n\n"
. implode( "\n", $setup['unknown'] )
. "\n*/\n"
. $css;
}
// Mark final file size
$this->stats['after']['size'] = strlen( $css = trim( $css ) );
// Return compressed css
return $css;
}
/**
* Runs css through initial setup handlers
*
* @param (string) css: Sheet to compress
*/
private function setup( $css ) {
// Initial stats
$this->stats['before']['time'] = microtime( true );
$this->stats['before']['size'] = strlen( $css );
// Initial trimming
$css = $this->Trim->trim( $css );
// Do a little tokenizing, compress each property individually
$setup = $this->Setup->setup( $css );
// Mark number of selectors pre-combine
$this->stats['before']['selectors'] = count( $setup['selectors'] );
return $setup;
}
/**
* Focus compressions on each rule set
*
* @param (array) setup: Array containing selectors and rule sets
*/
private function rulesets( $setup ) {
// Do selector specific compressions
$this->Selectors->selectors( $setup['selectors'] );
// Look at each group of properties as a whole, and compress/combine similiar definitions
$this->Combine->combine( $setup['selectors'], $setup['details'] );
// If order isn't important, run comination functions before and after compressions to catch all instances
// Be sure to prune before hand for higher chance of matching
if ( $this->options['organize'] ) {
$this->Cleanup->cleanup( $setup['selectors'], $setup['details'] );
$this->Organize->organize( $setup['selectors'], $setup['details'] );
$this->Combine->combine( $setup['selectors'], $setup['details'] );
}
// Do final maintenace work, remove injected property/values
$this->Cleanup->cleanup( $setup['selectors'], $setup['details'] );
// Run final counters before full cleanup
$this->finalCount( $setup['selectors'], $setup['details'] );
return $setup;
}
/**
* Runs final counts on selectors and props
*
* @param (array) selectors: Selector rules
* @param (array) details: Rule sets
*/
private function finalCount( $selectors, $details ) {
// Selectors and props
$this->stats['after']['selectors'] = count( $selectors );
foreach ( $details as $item ) {
$props = preg_split( $this->rsemicolon, $item );
// Make sure count is true
foreach ( $props as $k => $v ) {
if ( ! isset( $v ) || $v == '' ) {
unset( $props[ $k ] );
}
}
$this->stats['after']['props'] += count( $props );
}
// Final count for stats
$this->stats['after']['time'] = microtime( true );
}
/**
* Formats the compressed rule sets into a stylesheet
*
* @param (array) setup: Array containing selectors and rule sets
*/
private function readability( $setup ) {
// Format css to users preference
$css = $this->Format->readability( $this->options['readability'], $setup['selectors'], $setup['details'] );
// Intros
foreach ( $setup as $value ) {
if ( $value && is_string( $value ) ) {
$css = $value . $css;
}
}
// Remove escapables
$css = $this->Cleanup->removeInjections( $css );
return $css;
}
/**
* Access to private methods for testing
*
* @param (string) method: Method to be called
* @param (array) args: Array of paramters to be passed in
*/
public function access( $method, $args ) {
if ( method_exists( $this, $method ) ) {
return call_user_func_array( array( $this, $method ), $args );
}
else {
throw new CSSCompression_Exception( "Unknown method in Compress Class - " . $method );
}
}
};
?>

View File

@@ -1,236 +0,0 @@
<?php
/**
* CSS Compressor [VERSION]
* [DATE]
* Corey Hart @ http://www.codenothing.com
*/
Class CSSCompression_Control
{
/**
* Control Patterns
*
* @param (string) css: Holds compressed css string
* @param (string) mode: Current compression mode state
* @param (array) stats: Holds compression stats
* @param (array) getters: Array of accessible getters
*/
public $css = '';
public $mode = '';
public $stats = array();
private $getters = array(
'css',
'mode',
'stats',
);
/**
* Subclasses that do the ground work for this compressor
*
* @class CSSCompression: Public facing compression class
* @class Option: Option handling
* @class Trim: Does the initial trimming for the css
* @class Format: Formats the output
* @class Numeric: Handles numeric compression
* @class Color: Handles color compression
* @class Individuals: Runs compression algorithms on individual properties and values
* @class Selectors: Runs selector specific compressions
* @class Combine: Handles combining of various properties
* @class Organize: Reorganizes the sheet for futher compression
* @class Cleanup: Cleans out all injected characters during compression
* @class Compress: Central compression unit.
* @param (array) subclasses: Array holding all the subclasses for inlusion
*/
public $CSSCompression;
public $Option;
public $Trim;
public $Format;
public $Numeric;
public $Color;
public $Individuals;
public $Selectors;
public $Combine;
public $Organize;
public $Cleanup;
public $Setup;
public $Compress;
private $subclasses = array(
'Option',
'Trim',
'Format',
'Numeric',
'Color',
'Individuals',
'Selectors',
'Combine',
'Organize',
'Cleanup',
'Setup',
'Compress',
);
/**
* Pull in the Compression instance and build the subclasses
*
* @param (class) CSSCompression: CSSCompression Instance
*/
public function __construct( CSSCompression $CSSCompression ) {
$this->CSSCompression = $CSSCompression;
// Load all subclasses on demand
if ( ! class_exists( "CSSCompression_Option", false ) ) {
$path = dirname(__FILE__) . '/';
foreach ( $this->subclasses as $class ) {
require( $path . $class . '.php' );
}
}
// Initialize each subclass
foreach ( $this->subclasses as $class ) {
$full = "CSSCompression_$class";
$this->$class = new $full( $this );
}
}
/**
* Control access to properties
*
* - Getting stats/mode/css returns the current value of that property
* - Getting options will return the current full options array
* - Getting anything else returns that current value in the options array or NULL
*
* @param (string) name: Name of property that you want to access
*/
public function get( $name ) {
if ( in_array( $name, $this->getters ) ) {
return $this->$name;
}
else if ( $name == 'options' ) {
return $this->Option->options;
}
else {
return $this->Option->option( $name );
}
}
/**
* The setter method only allows access to setting values in the options array
*
* @param (string) name: Key name of the option you want to set
* @param (mixed) value: Value of the option you want to set
*/
public function set( $name, $value ) {
// Allow for passing array of options to merge into current ones
if ( $name === 'options' && is_array( $value ) ) {
return $this->Option->merge( $value );
}
else if ( isset( CSSCompression::$defaults[ $name ] ) ) {
return $this->Option->option( $name, $value );
}
else {
throw new CSSCompression_Exception( "Invalid Private Access to $name in CSSCompression." );
}
}
/**
* Merges a predefined set options
*
* @param (string) mode: Name of mode to use.
*/
public function mode( $mode = NULL ) {
return $this->Options->merge( $mode );
}
/**
* Resets options to their defaults, and flushes out variables
*
* @params none
*/
public function reset(){
$this->Option->reset();
return $this->flush();
}
/**
* Cleans out class variables for next run
*
* @params none
*/
public function flush(){
$this->css = '';
$this->stats = array(
'before' => array(
'props' => 0,
'selectors' => 0,
'size' => 0,
'time' => 0,
),
'after' => array(
'props' => 0,
'selectors' => 0,
'size' => 0,
'time' => 0,
),
);
return true;
}
/**
* Proxy to run Compression on the sheet passed. Handle options here.
*
* @param (string) css: Stylesheet to be compressed
* @param (mixed) options: Array of options or mode to use.
*/
public function compress( $css = NULL, $options = NULL ) {
// Flush out old stats and variables
$this->flush();
// If no additional options, just run compression
if ( $options === NULL ) {
return $this->css = $this->Compress->compress( $css );
}
// Store old params
$old = $this->mode == '__custom' ? $this->Option->option() : $this->mode;
$readability = $this->Option->option( 'readability' );
// Compress with new set of options
$this->Option->merge( $options );
$css = $this->Compress->compress( $css );
// Reset original options
$this->reset();
$this->Option->merge( $old );
// Return the compressed css
return $this->css = $css;
}
/**
* Backdoor access to subclasses
* ONLY FOR DEVELOPMENT/TESTING.
*
* @param (string) class: Name of the focus class
* @param (array) config: Contains name reference and test arguments
*/
public function access( $class, $method, $args ) {
if ( $class == 'Control' ) {
return call_user_func_array( array( $class, $method ), $args );
}
else if ( strpos( $class, '.' ) !== false ) {
$parts = explode( '.', $class );
$class = $parts[ 0 ];
$subclass = $parts[ 1 ];
return $this->$class->access( $subclass, $method, $args );
}
else if ( in_array( $class, $this->subclasses ) ) {
return $this->$class->access( $method, $args );
}
else {
throw new CSSCompression_Exception( "Unknown Class Access - " . $class );
}
}
};
?>

View File

@@ -1,32 +0,0 @@
<?php
/**
* CSS Compressor [VERSION]
* [DATE]
* Corey Hart @ http://www.codenothing.com
*/
Class CSSCompression_Exception extends Exception
{
/**
* Custom exception handler
*
* @param (string) message: Error message
* @param (int) code: Error code
* @instance (Exception Instance) previous: Previous exception
*/
public function __construct( $message = 'Unknown Exception', $code = 0, Exception $previous = NULL ) {
parent::__construct( $message, $code, $previous );
}
/**
* String version of this custom exception
*
* @params none
*/
public function __toString(){
return "CSSCompression Exception: [" . $this->code . "] " . $this->message . "\n";
}
};
?>

View File

@@ -1,187 +0,0 @@
<?php
/**
* CSS Compressor [VERSION]
* [DATE]
* Corey Hart @ http://www.codenothing.com
*/
Class CSSCompression_Format
{
/**
* Format Patterns
*
* @class Control: Compression Controller
* @param (string) token: Copy of the injection token
* @param (array) options: Reference to options
* @param (regex) rsemicolon: Checks for semicolon without an escape '\' character before it
* @param (regex) rcolon: Checks for colon without an escape '\' character before it
* @param (array) readability: Mapping to readability functions
*/
private $Control;
private $token = '';
private $options = array();
private $rsemicolon = "/(?<!\\\);/";
private $rcolon = "/(?<!\\\):/";
private $readability = array(
CSSCompression::READ_MAX => 'maximum',
CSSCompression::READ_MED => 'medium',
CSSCompression::READ_MIN => 'minimum',
CSSCompression::READ_NONE => 'none',
);
/**
* Stash a reference to the controller on each instantiation
*
* @param (class) control: CSSCompression Controller
*/
public function __construct( CSSCompression_Control $control ) {
$this->Control = $control;
$this->token = CSSCompression::TOKEN;
$this->options = &$control->Option->options;
}
/**
* Reformats compressed CSS into specified format
*
* @param (int) readability: Readability level of compressed output
* @param (array) selectors: Array of selectors
* @param (array) details: Array of declarations
*/
public function readability( $readability = CSSCompression::READ_NONE, $selectors = array(), $details = array() ) {
if ( isset( $this->readability[ $readability ] ) ) {
$fn = $this->readability[ $readability ];
return trim( $this->$fn( $selectors, $details ) );
}
else {
return 'Invalid Readability Value';
}
}
/**
* Returns maxium readability, breaking on every selector, brace, and property
*
* @param (array) selectors: Array of selectors
* @param (array) details: Array of declarations
*/
private function maximum( $selectors, $details ) {
$css = '';
foreach ( $selectors as $k => $v ) {
if ( strpos( $v, $this->token ) === 0 ) {
$css .= substr( $v, strlen( $this->token ) );
$css .= $details[ $k ];
continue;
}
else if ( ! $details[ $k ] || trim( $details[ $k ] ) == '' ) {
continue;
}
$v = str_replace( '>', ' > ', $v );
$v = str_replace( '+', ' + ', $v );
$v = str_replace( ',', ', ', $v );
$css .= "$v {\n";
$arr = preg_split( $this->rsemicolon, $details[ $k ] );
foreach ( $arr as $item ) {
if ( ! $item ) {
continue;
}
list( $prop, $val ) = preg_split( $this->rcolon, $item, 2 );
$css .= "\t$prop: $val;\n";
}
// Kill that last semicolon at users request
if ( $this->options['unnecessary-semicolons'] ) {
$css = preg_replace( "/;\n$/", "\n", $css );
}
$css .= "}\n\n";
}
return $css;
}
/**
* Returns medium readability, putting selectors and rule sets on new lines
*
* @param (array) selectors: Array of selectors
* @param (array) details: Array of declarations
*/
private function medium( $selectors, $details ) {
$css = '';
foreach ( $selectors as $k => $v ) {
if ( strpos( $v, $this->token ) === 0 ) {
$css .= substr( $v, strlen( $this->token ) );
$css .= $details[ $k ];
continue;
}
else if ( $details[ $k ] && $details[ $k ] != '' ) {
$css .= "$v {\n\t" . $details[ $k ] . "\n}\n";
}
}
return $css;
}
/**
* Returns minimum readability, breaking after every selector and it's rule set
*
* @param (array) selectors: Array of selectors
* @param (array) details: Array of declarations
*/
private function minimum( $selectors, $details ) {
$css = '';
foreach ( $selectors as $k => $v ) {
if ( strpos( $v, $this->token ) === 0 ) {
$css .= substr( $v, strlen( $this->token ) );
$css .= $details[ $k ];
continue;
}
else if ( $details[ $k ] && $details[ $k ] != '' ) {
$css .= "$v{" . $details[ $k ] . "}\n";
}
}
return $css;
}
/**
* Returns an unreadable, but fully compressed script
*
* @param (array) selectors: Array of selectors
* @param (array) details: Array of declarations
*/
private function none( $selectors, $details ) {
$css = '';
foreach ( $selectors as $k => $v ) {
if ( strpos( $v, $this->token ) === 0 ) {
$css .= substr( $v, strlen( $this->token ) );
$css .= $details[ $k ];
continue;
}
else if ( $details[ $k ] && $details[ $k ] != '' ) {
$css .= trim( "$v{" . $details[ $k ] . "}" );
}
}
return $css;
}
/**
* Access to private methods for testing
*
* @param (string) method: Method to be called
* @param (array) args: Array of paramters to be passed in
*/
public function access( $method, $args ) {
if ( method_exists( $this, $method ) ) {
return call_user_func_array( array( $this, $method ), $args );
}
else {
throw new CSSCompression_Exception( "Unknown method in Format Class - " . $method );
}
}
};
?>

View File

@@ -1,307 +0,0 @@
<?php
/**
* CSS Compressor [VERSION]
* [DATE]
* Corey Hart @ http://www.codenothing.com
*/
Class CSSCompression_Individuals
{
/**
* Individual patterns
*
* @class Control: Compression Controller
* @class Numeric: Numeric handler
* @class Color: Color Handler
* @param (array) options: Reference to options
* @param (regex) rdirectional: Properties that may have multiple directions
* @param (regex) rborderradius: Checks property for border-radius declaration
* @param (regex) rnoneprop: Properties that can have none as their value(will be converted to 0)
* @param (regex) rclip: Looks for rect grouping in clip declaration
* @param (regex) rsplitter: Checks font properties for font-size/line-height split
* @param (regex) rfilter: Special alpha filter for msie
* @param (regex) rspace: Checks for unescaped space
* @param (regex) rspace: Checks for unescaped slash
* @param (array) weights: Array of font-weight name conversions to their numeric counterpart
*/
private $Control;
private $Numeric;
private $Color;
private $options = array();
private $rdirectional = "/^(margin|padding|border-spacing)$/";
private $rborderradius = "/border[a-z-]*radius/";
private $rradiusfull = "/^(-moz-|-webkit-)?border-radius$/";
private $rnoneprop = "/^(border|background|border-(top|right|bottom|left))$/";
private $rclip = "/^rect\(\s*(\-?\d*\.?\d*?\w*)(,|\s)(\-?\d*\.?\d*?\w*)(,|\s)(\-?\d*\.?\d*?\w*)(,|\s)(\-?\d*\.?\d*?\w*)\s*\)$/";
private $rsplitter = "/(^|(?<!\\\)\s)([^\/ ]+)\/([^\/ ]+)((?<!\\\)\s|$)/";
private $rfilter = "/[\"']?PROGID\\\?:DXImageTransform\\\?.Microsoft\\\?.Alpha\(Opacity\\\?=(\d+\\\?\.?\d*)\)[\"']?/i";
private $rspace = "/(?<!\\\)\s/";
private $rslash = "/(?<!\\\)\//";
private $weights = array(
"normal" => 400,
"bold" => 700,
);
/**
* Stash a reference to the controller on each instantiation
*
* @param (class) control: CSSCompression Controller
*/
public function __construct( CSSCompression_Control $control ) {
$this->Control = $control;
$this->Numeric = $control->Numeric;
$this->Color = $control->Color;
$this->options = &$control->Option->options;
}
/**
* Runs special unit/directional compressions
*
* @param (string) prop: CSS Property
* @param (string) val: Value of CSS Property
*/
public function individuals( $prop, $val ) {
// Properties should always be lowercase
$prop = strtolower( $prop );
// Split up each definiton for color and numeric compressions
$parts = preg_split( $this->rspace, $val );
foreach ( $parts as &$v ) {
if ( ! $v || $v == '' ) {
continue;
}
// Remove uneeded decimals/units
if ( $this->options['format-units'] ) {
$v = $this->Numeric->numeric( $v );
}
// Color compression
$v = $this->Color->color( $v );
}
$val = trim( implode( ' ', $parts ) );
// Special border radius handling
if ( preg_match( $this->rborderradius, $prop ) ) {
$val = $this->borderRadius( $prop, $val );
}
// Remove uneeded side definitions if possible
else if ( $this->options['directional-compress'] && count( $parts ) > 1 && preg_match( $this->rdirectional, $prop ) ) {
$val = $this->directionals( strtolower( $val ) );
}
// Font-weight converter
if ( $this->options['fontweight2num'] && ( $prop == 'font-weight' || $prop == 'font' ) ) {
$val = $this->fontweight( $val );
}
// Special font value conversions
if ( $prop == 'font' ) {
$val = $this->font( $val );
}
// Special clip value compressions
if ( $prop == 'clip' ) {
$val = $this->clip( $val );
}
// None to 0 converter
$val = $this->none( $prop, $val );
// MSIE Filters
$val = $this->filter( $prop, $val );
// Return for list retrival
return array( $prop, $val );
}
/**
* Preps border radius for directional compression
*
* @param (string) prop: Property Declaration
* @param (string) val: Declaration Value
*/
private function borderRadius( $prop, $val ) {
if ( preg_match( $this->rslash, $val ) ) {
$parts = preg_split( $this->rslash, $val, 2 );
// We have to redo numeric compression because the slash may hav intruded
foreach ( $parts as &$row ) {
$p = preg_split( $this->rspace, $row );
foreach ( $p as &$v ) {
if ( ! $v || $v == '' ) {
continue;
}
// Remove uneeded decimals/units
if ( $this->options['format-units'] ) {
$v = $this->Numeric->numeric( $v );
}
}
$row = implode( ' ', $p );
if ( $this->options['directional-compress'] ) {
$row = $this->directionals( strtolower( $row ) );
}
}
$val = implode( '/', $parts );
}
else if ( $this->options['directional-compress'] && preg_match( $this->rradiusfull, $prop ) ) {
$val = $this->directionals( strtolower( $val ) );
}
return $val;
}
/**
* Finds directional compression on methods like margin/padding
*
* @param (string) val: Value of CSS Property
*/
private function directionals( $val ) {
// Split up each definiton
$direction = preg_split( $this->rspace, $val );
// 4 Direction reduction
$count = count( $direction );
if ( $count == 4 ) {
// All 4 sides are the same, combine into 1 definition
if ( $direction[ 0 ] == $direction[ 1 ] && $direction[ 2 ] == $direction[ 3 ] && $direction[ 0 ] == $direction[ 3 ] ) {
$direction = array( $direction[ 0 ] );
}
// top-bottom/left-right are the same, reduce definition
else if ( $direction[ 0 ] == $direction[ 2 ] && $direction[ 1 ] == $direction[ 3 ] ) {
$direction = array( $direction[ 0 ], $direction[ 1 ] );
}
// Only left-right are the same
else if ( $direction[ 1 ] == $direction[ 3 ] ) {
$direction = array( $direction[ 0 ], $direction[ 1 ], $direction[ 2 ] );
}
}
// 3 Direction reduction
else if ( $count == 3 ) {
// All directions are the same
if ( $direction[ 0 ] == $direction[ 1 ] && $direction[ 1 ] == $direction[ 2 ] ) {
$direction = array( $direction[ 0 ] );
}
// Only top(first) and bottom(last) are the same
else if ( $direction[ 0 ] == $direction[ 2 ] ) {
$direction = array( $direction[ 0 ], $direction[ 1 ] );
}
}
// 2 Direction reduction
// Both directions are the same, combine into single definition
else if ( $count == 2 && $direction[ 0 ] == $direction[ 1 ] ) {
$direction = array( $direction[ 0 ] );
}
// Return the combined version of the directions
// Single entries will just return
return implode( ' ', $direction );
}
/**
* Converts font-weight names to numbers
*
* @param (string) val: font-weight prop value
*/
private function fontweight( $val ) {
if ( preg_match( $this->rspace, $val ) ) {
$parts = preg_split( $this->rspace, $val );
foreach ( $parts as &$item ) {
$lower = strtolower( $item );
if ( isset( $this->weights[ $lower ] ) && $lower != 'normal' ) {
$item = $this->weights[ $lower ];
}
}
$val = implode( ' ', $parts );
}
else if ( isset( $this->weights[ strtolower( $val ) ] ) ) {
$val = $this->weights[ strtolower( $val ) ];
}
return $val;
}
/**
* Special font conversions
*
* @param (string) val: property value
*/
private function font( $val ) {
// Split out the font-size/line-height split and run through numerical handlers
if ( preg_match( $this->rsplitter, $val, $match, PREG_OFFSET_CAPTURE ) ) {
$size = $this->Numeric->numeric( $match[ 2 ][ 0 ] );
$height = $this->Numeric->numeric( $match[ 3 ][ 0 ] );
$concat = $match[ 1 ][ 0 ] . $size . '/' . $height . $match[ 4 ][ 0 ];
$val = substr_replace( $val, $concat, $match[ 0 ][ 1 ], strlen( $match[ 0 ][ 0 ] ) );
}
return $val;
}
/**
* Special clip conversions
*
* @param (string) val: property value
*/
private function clip( $val ) {
if ( preg_match( $this->rclip, $val, $match ) ) {
$positions = array( 1, 3, 5, 7 );
$clean = 'rect(';
foreach ( $positions as $pos ) {
if ( ! isset( $match[ $pos ] ) ) {
return $val;
}
$clean .= $this->Numeric->numeric( $match[ $pos ] ) . ( isset( $match[ $pos + 1 ] ) ? $match[ $pos + 1 ] : '' );
}
$val = $clean . ')';
}
return $val;
}
/**
* Convert none vals to 0
*
* @param (string) prop: Current Property
* @param (string) val: property value
*/
private function none( $prop, $val ) {
if ( preg_match( $this->rnoneprop, $prop ) && $val == 'none' ) {
$val = '0';
}
return $val;
}
/**
* MSIE Filter Conversion
*
* @param (string) prop: Current Property
* @param (string) val: property value
*/
private function filter( $prop, $val ) {
if ( preg_match( "/filter/", $prop ) ) {
$val = preg_replace( $this->rfilter, "alpha(opacity=$1)", $val );
}
return $val;
}
/**
* Access to private methods for testing
*
* @param (string) method: Method to be called
* @param (array) args: Array of paramters to be passed in
*/
public function access( $method, $args ) {
if ( method_exists( $this, $method ) ) {
return call_user_func_array( array( $this, $method ), $args );
}
else {
throw new CSSCompression_Exception( "Unknown method in Individuals Class - " . $method );
}
}
};
?>

View File

@@ -1,103 +0,0 @@
<?php
/**
* CSS Compressor [VERSION]
* [DATE]
* Corey Hart @ http://www.codenothing.com
*/
Class CSSCompression_Numeric
{
/**
* Numeric Patterns
*
* @class Control: Compression Controller
* @param (array) options: Reference to options
* @param (regex) rdecimal: Checks for zero decimal
* @param (regex) rzero: Checks for preceding 0 to decimal unit
* @param (regex) runit: Checks for suffix on 0 unit
*/
private $Control;
private $options = array();
private $rdecimal = "/^(\+|\-)?(\d*\.[1-9]*0*)(\%|[a-z]{2})$/i";
private $rzero = "/^(\+|\-)?0(\.\d+)(\%|[a-z]{2})?$/i";
private $runit = "/^0(\%|[a-z]{2})$/i";
/**
* Stash a reference to the controller on each instantiation
*
* @param (class) control: CSSCompression Controller
*/
public function __construct( CSSCompression_Control $control ) {
$this->Control = $control;
$this->options = &$control->Option->options;
}
/**
* Runs all numeric operations
*
* @param (string) str: Unit string
*/
public function numeric( $str ) {
$str = $this->decimal( $str );
$str = $this->zeroes( $str );
$str = $this->units( $str );
return $str;
}
/**
* Remove's unecessary decimal, ie 13.0px => 13px
*
* @param (string) str: Unit string
*/
private function decimal( $str ) {
if ( preg_match( $this->rdecimal, $str, $match ) ) {
$str = ( $match[ 1 ] == '-' ? '-' : '' ) . floatval( $match[ 2 ] ) . $match[ 3 ];
}
return $str;
}
/**
* Removes suffix from 0 unit, ie 0px; => 0;
*
* @param (string) str: Unit string
*/
private function units( $str ) {
if ( preg_match( $this->runit, $str, $match ) ) {
$str = '0';
}
return $str;
}
/**
* Removes leading zero in decimal, ie 0.33px => .33px
*
* @param (string) str: Unit string
*/
private function zeroes( $str ) {
if ( preg_match( $this->rzero, $str, $match ) ) {
$str = ( isset( $match[ 1 ] ) && $match[ 1 ] == '-' ? '-' : '' ) . $match[ 2 ] . ( isset( $match[ 3 ] ) ? $match[ 3 ] : '' );
}
return $str;
}
/**
* Access to private methods for testing
*
* @param (string) method: Method to be called
* @param (array) args: Array of paramters to be passed in
*/
public function access( $method, $args ) {
if ( method_exists( $this, $method ) ) {
return call_user_func_array( array( $this, $method ), $args );
}
else {
throw new CSSCompression_Exception( "Unknown method in Numeric Class - " . $method );
}
}
};
?>

View File

@@ -1,133 +0,0 @@
<?php
/**
* CSS Compressor [VERSION]
* [DATE]
* Corey Hart @ http://www.codenothing.com
*/
Class CSSCompression_Option
{
/**
* Option Patterns
*
* @class Control: Compression Controller
* @param (string) custom: Name of the custom mode
* @param (array) options: Instance settings
*/
private $Control;
private $custom = '__custom';
public $options = array();
/**
* Stash a reference to the controller on each instantiation
*
* @param (class) control: CSSCompression Controller
*/
public function __construct( CSSCompression_Control $control ) {
$this->Control = $control;
$this->options = CSSCompression::$defaults;
$control->mode = $this->custom;
}
/**
* Maintainable access to the options array
*
* - Passing no arguments returns the entire options array
* - Passing a single name argument returns the value for the option
* - Passing both a name and value, sets the value to the name key, and returns the value
* - Passing an array will merge the options with the array passed, for object like extension
*
* @param (mixed) name: The key name of the option
* @param (mixed) value: Value to set the option
*/
public function option( $name = NULL, $value = NULL ) {
if ( $name === NULL ) {
return $this->options;
}
else if ( is_array( $name ) ) {
return $this->merge( $name );
}
else if ( $value === NULL ) {
return isset( $this->options[ $name ] ) ? $this->options[ $name ] : NULL;
}
else {
// Readability doesn't signify custom settings
if ( $name != 'readability' ) {
$this->Control->mode = $this->custom;
}
return ( $this->options[ $name ] = $value );
}
}
/**
* Reset's the default options
*
* @params none;
*/
public function reset(){
// Reset and return the new options
return $this->options = CSSCompression::$defaults;
}
/**
* Extend like function to merge an array of preferences into
* the options array.
*
* @param (mixed) options: Array of preferences to merge into options
*/
public function merge( $options = array() ) {
$modes = CSSCompression::modes();
if ( $options && is_array( $options ) && count( $options ) ) {
$this->Control->mode = $this->custom;
foreach ( $this->options as $key => $value ) {
if ( ! isset( $options[ $key ] ) ) {
continue;
}
else if ( strtolower( $options[ $key ] ) == 'on' ) {
$this->options[ $key ] = true;
}
else if ( strtolower( $options[ $key ] ) == 'off' ) {
$this->options[ $key ] = false;
}
else {
$this->options[ $key ] = intval( $options[ $key ] );
}
}
}
else if ( $options && is_string( $options ) && array_key_exists( $options, $modes ) ) {
$this->Control->mode = $options;
// Default all to true, the mode has to force false
foreach ( $this->options as $key => $value ) {
if ( $key != 'readability' ) {
$this->options[ $key ] = true;
}
}
// Merge mode into options
foreach ( $modes[ $options ] as $key => $value ) {
$this->options[ $key ] = $value;
}
}
return $this->options;
}
/**
* Access to private methods for testing
*
* @param (string) method: Method to be called
* @param (array) args: Array of paramters to be passed in
*/
public function access( $method, $args ) {
if ( method_exists( $this, $method ) ) {
return call_user_func_array( array( $this, $method ), $args );
}
else {
throw new CSSCompression_Exception( "Unknown method in Option Class - " . $method );
}
}
};
?>

View File

@@ -1,149 +0,0 @@
<?php
/**
* CSS Compressor [VERSION]
* [DATE]
* Corey Hart @ http://www.codenothing.com
*/
Class CSSCompression_Organize
{
/**
* Organize Patterns
*
* @class Control: Compression Controller
* @param (array) options: Reference to options
* @param (regex) rsemicolon: Checks for semicolon without an escape '\' character before it
* @param (regex) rlastsemi: Checks for semicolon at the end of the string
*/
private $Control;
private $options = array();
private $rsemicolon = "/(?<!\\\);/";
private $rlastsemi = "/(?<!\\\);$/";
/**
* Stash a reference to the controller on each instantiation
*
* @param (class) control: CSSCompression Controller
*/
public function __construct( CSSCompression_Control $control ) {
$this->Control = $control;
$this->options = &$control->Option->options;
}
/**
* Look to see if we can combine selectors to reduce the number
* of definitions.
*
* @param (array) selectors: Array of selectors, map directly to details
* @param (array) details: Array of rule sets, map directly to selectors
*/
public function organize( &$selectors = array(), &$details = array() ) {
// Combining defns based on similar selectors
list ( $selectors, $details ) = $this->reduceSelectors( $selectors, $details );
// Combining defns based on similar details
list ( $selectors, $details ) = $this->reduceDetails( $selectors, $details );
// Return in package form
return array( $selectors, $details );
}
/**
* Combines multiply defined selectors by merging the rule sets,
* latter declarations overide declaratins at top of file
*
* @param (array) selectors: Array of selectors broken down by setup
* @param (array) details: Array of rule sets broken down by setup
*/
private function reduceSelectors( $selectors, $details ) {
$keys = array_keys( $selectors );
$max = array_pop( $keys ) + 1;
for ( $i = 0; $i < $max; $i++ ) {
if ( ! isset( $selectors[ $i ] ) ) {
continue;
}
for ( $k = $i + 1; $k < $max; $k++ ) {
if ( ! isset( $selectors[ $k ] ) ) {
continue;
}
if ( $selectors[ $i ] == $selectors[ $k ] ) {
// Prevent noticies
if ( ! isset( $details[ $i ] ) ) {
$details[ $i ] = '';
}
if ( ! isset( $details[ $k ] ) ) {
$details[ $k ] = '';
}
// We kill the last semicolon before organization, so account for that.
if ( $details[ $i ] != '' && $details[ $k ] != '' && ! preg_match( $this->rlastsemi, $details[ $i ] ) ) {
$details[ $i ] .= ';' . $details[ $k ];
}
else {
$details[ $i ] .= $details[ $k ];
}
// Remove the second part
unset( $selectors[ $k ], $details[ $k ] );
}
}
}
return array( $selectors, $details );
}
/**
* Combines multiply defined rule sets by merging the selectors
* in comma seperated format
*
* @param (array) selectors: Array of selectors broken down by setup
* @param (array) details: Array of rule sets broken down by setup
*/
private function reduceDetails( $selectors, $details ) {
$keys = array_keys( $selectors );
$max = array_pop( $keys ) + 1;
for ( $i = 0; $i < $max; $i++ ) {
if ( ! isset( $selectors[ $i ] ) ) {
continue;
}
$arr = preg_split( $this->rsemicolon, isset( $details[ $i ] ) ? $details[ $i ] : '' );
for ( $k = $i + 1; $k < $max; $k++ ) {
if ( ! isset( $selectors[ $k ] ) ) {
continue;
}
$match = preg_split( $this->rsemicolon, isset( $details[ $k ] ) ? $details[ $k ] : '' );
$x = array_diff( $arr, $match );
$y = array_diff( $match, $arr );
if ( count( $x ) < 1 && count( $y ) < 1 ) {
$selectors[ $i ] .= ',' . $selectors[ $k ];
unset( $details[ $k ], $selectors[ $k ] );
}
}
}
return array( $selectors, $details );
}
/**
* Access to private methods for testing
*
* @param (string) method: Method to be called
* @param (array) args: Array of paramters to be passed in
*/
public function access( $method, $args ) {
if ( method_exists( $this, $method ) ) {
return call_user_func_array( array( $this, $method ), $args );
}
else {
throw new CSSCompression_Exception( "Unknown method in Organize Class - " . $method );
}
}
};
?>

View File

@@ -1,245 +0,0 @@
<?php
/**
* CSS Compressor [VERSION]
* [DATE]
* Corey Hart @ http://www.codenothing.com
*/
Class CSSCompression_Selectors
{
/**
* Selector patterns
*
* @class Control: Compression Controller
* @param (string) token: Copy of the injection token
* @param (regex) ridattr: ID Attribute matcher (combined with token)
* @param (regex) rclassattr: class Attribute matcher (combined with token)
* @param (array) options: Reference to options
* @param (regex) rmark: Stop points during selector parsing
* @param (regex) ridclassend: End of a id/class string
* @param (regex) rescapedspace: for replacement in class attributes
* @param (regex) rquote: Checks for the next quote character
* @param (regex) rcomma: looks for an unescaped comma character
* @param (regex) rspace: looks for an unescaped space character
* @param (regex) rid: looks for an unescaped hash character
* @param (regex) rpseudo: Add space after first-letter|line pseudo selector
* --- when it occurs before comma or rule set
*/
private $Control;
private $token = '';
private $ridattr = "";
private $rclassattr = "";
private $options = array();
private $rmark = "/(?<!\\\)(#|\.|=)/";
private $ridclassend = "/(?<!\\\)[:#>~\[\+\*\. ]/";
private $rquote = "/(?<!\\\)(\"|')?\]/";
private $rescapedspace = "/\\\ /";
private $rcomma = "/(?<!\\\),/";
private $rspace = "/(?<!\\\)\s/";
private $rid = "/(?<!\\\)#/";
private $rpseudo = "/:first-(letter|line)(,|$)/i";
/**
* Stash a reference to the controller on each instantiation
*
* @param (class) control: CSSCompression Controller
*/
public function __construct( CSSCompression_Control $control ) {
$this->Control = $control;
$this->token = CSSCompression::TOKEN;
$this->ridattr = "/\[id=$this->token(.*?)$this->token\]/";
$this->rclassattr = "/\[class=$this->token(.*?)$this->token\]/";
$this->options = &$control->Option->options;
}
/**
* Selector specific optimizations
*
* @param (array) selectors: Array of selectors
*/
public function selectors( &$selectors = array() ) {
foreach ( $selectors as &$selector ) {
// Auto ignore sections
if ( strpos( $selector, $this->token ) === 0 ) {
continue;
}
// Smart casing and token injection
$selector = $this->parse( $selector );
// Converting attr to shorthanded selectors
if ( $this->options['attr2selector'] ) {
// Use id hash instead of id attr
$selector = $this->idAttribute( $selector );
// Use class notation instead of class attr
$selector = $this->classAttribute( $selector );
}
// Remove everything before final id in a selector
if ( $this->options['strict-id'] ) {
$selector = $this->strictid( $selector );
}
// Get rid of possible repeated selectors
$selector = $this->repeats( $selector );
// Add space after pseudo selectors (so ie6 doesn't complain)
if ( $this->options['pseudo-space'] ) {
$selector = $this->pseudoSpace( $selector );
}
}
return $selectors;
}
/**
* Converts selectors like BODY => body, DIV => div
* and injects tokens wrappers for attribute values
*
* @param (string) selector: CSS Selector
*/
private function parse( $selector ) {
$clean = '';
$substr = '';
$pos = 0;
while ( preg_match( $this->rmark, $selector, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
$substr = substr( $selector, $pos, $match[ 0 ][ 1 ] + 1 - $pos );
$clean .= $this->options['lowercase-selectors'] ? strtolower( $substr ) : $substr;
$pos = $match[ 0 ][ 1 ] + strlen( $match[ 1 ][ 0 ] );
// Class or id match
if ( $match[ 1 ][ 0 ] == '#' || $match[ 1 ][ 0 ] == '.' ) {
if ( preg_match( $this->ridclassend, $selector, $m, PREG_OFFSET_CAPTURE, $pos ) ) {
$clean .= substr( $selector, $pos, $m[ 0 ][ 1 ] - $pos );
$pos = $m[ 0 ][ 1 ];
}
else {
$clean .= substr( $selector, $pos );
$pos = strlen( $selector );
break;
}
}
// Start of a string
else if ( preg_match( $this->rquote, $selector, $m, PREG_OFFSET_CAPTURE, $pos ) ) {
if ( $selector[ $pos ] == "\"" || $selector[ $pos ] == "'" ) {
$pos++;
}
$clean .= $this->token . substr( $selector, $pos, $m[ 0 ][ 1 ] - $pos ) . $this->token . ']';
$pos = $m[ 0 ][ 1 ] + strlen( $m[ 0 ][ 0 ] );
}
// No break points left
else {
$clean .= substr( $selector, $pos );
$pos = strlen( $selector );
break;
}
}
return $clean . ( $this->options['lowercase-selectors'] ? strtolower( substr( $selector, $pos ) ) : substr( $selector, $pos ) );
}
/**
* Convert [id=blah] attribute selectors into id form selector (#blah)
*
* @param (string) selector: CSS Selector
*/
private function idAttribute( $selector ) {
$pos = 0;
while ( preg_match( $this->ridattr, $selector, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
// Don't convert if space found (not valid hash selector)
if ( strpos( $match[ 1 ][ 0 ], ' ' ) !== false ) {
$pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] );
continue;
}
$selector = substr_replace( $selector, '#' . $match[ 1 ][ 0 ], $match[ 0 ][ 1 ], strlen( $match[ 0 ][ 0 ] ) );
$pos = $match[ 0 ][ 1 ] + strlen( $match[ 1 ][ 0 ] ) + 1;
}
return $selector;
}
/**
* Convert [class=blah] attribute selectors into class form selector (.blah)
*
* @param (string) selector: CSS Selector
*/
private function classAttribute( $selector ) {
$pos = 0;
while ( preg_match( $this->rclassattr, $selector, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
// Don't convert if prescense of dot separator found
if ( strpos( $match[ 1 ][ 0 ], '.' ) !== false ) {
$pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] );
continue;
}
$replace = '.' . preg_replace( $this->rescapedspace, ".", $match[ 1 ][ 0 ] );
$selector = substr_replace( $selector, $replace, $match[ 0 ][ 1 ], strlen( $match[ 0 ][ 0 ] ) );
$pos = $match[ 0 ][ 1 ] + strlen( $match[ 1 ][ 0 ] ) + 1;
}
return $selector;
}
/**
* Promotes nested id's to the front of the selector
*
* @param (string) selector: CSS Selector
*/
private function strictid( $selector ) {
$parts = preg_split( $this->rcomma, $selector );
foreach ( $parts as &$s ) {
if ( preg_match( $this->rid, $s ) ) {
$p = preg_split( $this->rid, $s );
$s = '#' . array_pop( $p );
}
}
return implode( ',', $parts );
}
/**
* Removes repeated selectors that have been comma separated
*
* @param (string) selector: CSS Selector
*/
private function repeats( $selector ) {
$parts = preg_split( $this->rcomma, $selector );
$parts = array_flip( $parts );
$parts = array_flip( $parts );
return implode( ',', $parts );
}
/**
* Adds space after pseudo selector for ie6 like a:first-child{ => a:first-child {
*
* @param (string) selector: CSS Selector
*/
private function pseudoSpace( $selector ) {
return preg_replace( $this->rpseudo, ":first-$1 $2", $selector );
}
/**
* Access to private methods for testing
*
* @param (string) method: Method to be called
* @param (array) args: Array of paramters to be passed in
*/
public function access( $method, $args ) {
if ( method_exists( $this, $method ) ) {
if ( $method == 'selectors' ) {
return $this->selectors( $args[ 0 ] );
}
else {
return call_user_func_array( array( $this, $method ), $args );
}
}
else {
throw new CSSCompression_Exception( "Unknown method in Selectors Class - " . $method );
}
}
};
?>

View File

@@ -1,292 +0,0 @@
<?php
/**
* CSS Compressor [VERSION]
* [DATE]
* Corey Hart @ http://www.codenothing.com
*/
Class CSSCompression_Setup
{
/**
* Trim Patterns
*
* @class Control: Compression Controller
* @class Individuals: Individuals Instance
* @instance instance: CSSCompression Instance
* @param (string) token: Copy of the injection token
* @param (array) options: Reference to options
* @param (array) stats: Reference to stats
* @param (regex) rsemicolon: Checks for semicolon without an escape '\' character before it
* @param (regex) rcolon: Checks for colon without an escape '\' character before it
* @param (regex) rbang: Checks for '!' without an escape '\' character before it
* @param (regex) rspacebank: Checks for an unescaped space before a bang character
* @param (regex) rliner: Matching known 1-line intros
* @param (regex) rnested: Matching known subsection handlers
* @param (regex) rurl: url wrapper matching
* @param (regex) rsinglequote: Checks for unescaped escaped single quote (mouthfull)
* @param (array) rsetup: Expanding stylesheet for semi-tokenizing
*/
private $Control;
private $Individuals;
private $instance;
private $token = '';
private $options = array();
private $stats = array();
private $rsemicolon = "/(?<!\\\);/";
private $rcolon = "/(?<!\\\):/";
private $rbang = "/(?<!\\\)\!/";
private $rspacebang = "/(?<!\\\)\s\!/";
private $rliner = "/^@(import|charset|namespace)/i";
private $rmedia = "/^@media/i";
private $rurl = "/url\((.*?)\)/";
private $rsinglequote = "/(?<!\\\)\\\'/";
private $rsetup = array(
'patterns' => array(
"/(?<!\\\){/",
"/(?<!\\\)}/",
"/(?<!\\\)@/",
"/(@(charset|import)[^;]*(?<!\\\);)/",
),
'replacements' => array(
"\n{\n",
"\n}\n",
"\n@",
"$1\n",
),
);
/**
* Stash a reference to the controller on each instantiation
*
* @param (class) control: CSSCompression Controller
*/
public function __construct( CSSCompression_Control $control ) {
$this->Control = $control;
$this->Individuals = $control->Individuals;
$this->token = CSSCompression::TOKEN;
$this->options = &$control->Option->options;
$this->stats = &$control->stats;
}
/**
* Setup selector and details arrays for compression methods
*
* @param (string) css: Trimed stylesheet
*/
public function setup( $css ) {
// Seperate the element from the elements details
$css = explode( "\n", preg_replace( $this->rsetup['patterns'], $this->rsetup['replacements'], $css ) );
$newline = $this->options['readability'] > CSSCompression::READ_NONE ? "\n" : '';
$setup = array(
'selectors' => array(),
'details' => array(),
'unknown' => array(),
'introliner' => '',
'namespace' => '',
'import' => '',
'charset' => '',
);
while ( count( $css ) ) {
$row = trim( array_shift( $css ) );
if ( $row == '' ) {
continue;
}
// Single block At-Rule set
else if ( $row[ 0 ] == '@' && $css[ 0 ] == '{' && trim( $css[ 1 ] ) != '' && $css[ 2 ] == '}' ) {
// Stash selector
array_push( $setup['selectors'], $row );
// Stash details (after the opening brace)
array_push( $setup['details'], $this->details( trim( $css[ 1 ] ) ) );
// drop the details from the stack
$css = array_slice( $css, 3 );
}
// Single line At-Rules (import/charset/namespace)
else if ( preg_match( $this->rliner, $row, $match ) ) {
$setup[ $match[ 1 ] ] .= $this->liner( $row ) . $newline;
}
// Nested At-Rule declaration blocks
else if ( $row[ 0 ] == '@' && $css[ 0 ] == '{' ) {
// Stash atrule as selector
array_push( $setup['selectors'], $this->token . $row );
// Stash details (after the opening brace)
array_push( $setup['details'], $this->nested( $css, preg_match( $this->rmedia, $row ) ) . $newline );
}
// Unknown single line At-Rules
else if ( $row[ 0 ] == '@' && substr( $row, -1 ) == ';' ) {
$setup[ 'introliner' ] .= $row . $newline;
}
// Declaration Block
else if ( count( $css ) >= 3 && $css[ 0 ] == '{' && $css[ 2 ] == '}' ) {
// Stash selector
array_push( $setup['selectors'], $row );
// Stash details (after the opening brace)
array_push( $setup['details'], $this->details( trim( $css[ 1 ] ) ) );
// drop the details from the stack
$css = array_slice( $css, 3 );
}
// Last catch, store unknown artifacts as selectors with a token
// and give it an empty rule set
else {
// Still add to unknown stack, for notification
array_push( $setup['unknown'], $row );
// Stash unknown artifacts as selectors with a token
array_push( $setup['selectors'], $this->token . $row );
// Give it an empty rule set
array_push( $setup['details'], '' );
}
}
return $setup;
}
/**
* Run nested elements through a separate instance of compression
*
* @param (array) css: Reference to the original css array
* @param (bool) organize: Whether or not to organize the subsection (only true for media sections)
*/
private function nested( &$css = array(), $organize = false ) {
$options = $this->options;
$left = 0;
$right = 0;
$row = '';
$independent = '';
$content = '';
$spacing = '';
$newline = $this->options['readability'] > CSSCompression::READ_NONE ? "\n" : '';
// Find the end of the nested section
while ( count( $css ) && ( $left < 1 || $left > $right ) ) {
$row = trim( array_shift( $css ) );
if ( $row == '' ) {
continue;
}
else if ( $row == '{' ) {
$left++;
}
else if ( $row == '}' ) {
$right++;
}
else if ( count( $css ) && substr( $row, 0, 1 ) != '@' && substr( $css[ 0 ], 0, 1 ) == '@' && substr( $row, -1 ) == ';' ) {
$independent .= $row;
continue;
}
$content .= $row;
}
// Ensure copy of instance exists
if ( ! $this->instance ) {
$this->instance = new CSSCompression();
}
// Fresh start
$this->instance->reset();
// Compress the nested section independently after removing the wrapping braces
// Also make sure to only organize media sections
if ( $options['organize'] == true && $organize == false ) {
$options['organize'] = false;
}
// Independent sections should be prepended to the next compressed section
$content = ( $independent == '' ? '' : $independent . $newline )
. $this->instance->compress( substr( $content, 1, -1 ), $options );
// Formatting for anything higher then 0 readability
if ( $newline == "\n" ) {
$content = "\n\t" . str_replace( "\n", "\n\t", $content ) . "\n";
$spacing = $this->options['readability'] > CSSCompression::READ_MIN ? ' ' : '';
}
// Stash the compressed nested script
return "$spacing{" . $content . "}$newline";
}
/**
* Converts import/namespace urls into strings
*
* @param (string) row: At-rule
*/
private function liner( $row ) {
$pos = 0;
while ( preg_match( $this->rurl, $row, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
$quote = preg_match( $this->rsinglequote, $match[ 1 ][ 0 ] ) ? '"' : "'";
$replace = $quote . $match[ 1 ][ 0 ] . $quote;
$row = substr_replace( $row, $replace, $match[ 0 ][ 1 ], strlen( $match[ 0 ][ 0 ] ) );
$pos = $match[ 0 ][ 1 ] + strlen( $replace );
}
return $row;
}
/**
* Run individual compression techniques on each property of a selector
*
* @param (string) row: Selector properties
*/
private function details( $row ) {
$row = preg_split( $this->rsemicolon, $row );
$parts = array();
$details = '';
foreach ( $row as $line ) {
// Set loopers
$parts = preg_split( $this->rcolon, $line, 2 );
$prop = '';
$value = '';
// Property
if ( isset( $parts[ 0 ] ) && ( $parts[ 0 ] = trim( $parts[ 0 ] ) ) != '' ) {
$prop = $parts[ 0 ];
}
// Value
if ( isset( $parts[ 1 ] ) && ( $parts[ 1 ] = trim( $parts[ 1 ] ) ) != '' ) {
$value = preg_replace( $this->rbang, ' !', $parts[ 1 ] );
}
// Fail safe, remove unspecified property/values
if ( $prop == '' || $value == '' ) {
continue;
}
// Run the tag/element through each compression
list ( $prop, $value ) = $this->Individuals->individuals( $prop, $value );
// Add counter to before stats
$this->stats['before']['props']++;
// Store the compressed element
$details .= "$prop:" . preg_replace( $this->rspacebang, '!', $value ) . ";";
}
return $details;
}
/**
* Access to private methods for testing
*
* @param (string) method: Method to be called
* @param (array) args: Array of paramters to be passed in
*/
public function access( $method, $args ) {
if ( method_exists( $this, $method ) ) {
return call_user_func_array( array( $this, $method ), $args );
}
else {
throw new CSSCompression_Exception( "Unknown method in Setup Class - " . $method );
}
}
};
?>

View File

@@ -1,213 +0,0 @@
<?php
/**
* CSS Compressor [VERSION]
* [DATE]
* Corey Hart @ http://www.codenothing.com
*/
Class CSSCompression_Trim
{
/**
* Trim Patterns
*
* @class Control: Compression Controller
* @param (array) options: Reference to options
* @param (regex) rcmark: Marking point when traversing through sheet for comments
* @param (regex) rendcomment: Finds the ending comment point
* @param (regex) rendquote: Finds the ending quote point
* @param (regex) rendsinglequote: Finds the ending single quote point
* @param (array) rescape: Array of patterns of groupings that should be escaped
* @param (array) trimmings: Stylesheet trimming patterns/replacements
* @param (array) escaped: Array of characters that need to be escaped
*/
private $Control;
private $options = array();
private $rcmark = "/((?<!\\\)\/\*|(?<!\\\)\"|(?<!\\\)')/";
private $rendcomment = "/\*\//";
private $rendquote = "/(?<!\\\)\"/";
private $rendsinglequote = "/(?<!\\\)'/";
private $rescape = array(
"/(url\()([^'\"].*?)(\))/is",
"/((?<!\\\)\")(.*?)((?<!\\\)\")/s",
"/((?<!\\\)')(.*?)((?<!\\\)')/s",
);
private $trimmings = array(
'patterns' => array(
"/(?<!\\\)(\s+)?(?<!\\\)([!,{};>\~\+\/])(?<!\\\)(\s+)?/s", // Remove un-needed spaces around special characters
"/url\((?<!\\\)\"(.*?)(?<!\\\)\"\)/is", // Remove quotes from urls
"/url\((?<!\\\)'(.*?)(?<!\\\)'\)/is", // Remove single quotes from urls
"/url\((.*?)\)/is", // Lowercase url wrapper
"/(?<!\\\);{2,}/", // Remove unecessary semi-colons
"/(?<!\\\)\s+/s", // Compress all spaces into single space
),
'replacements' => array(
'$2',
'url($1)',
'url($1)',
'url($1)',
';',
' ',
)
);
private $escaped = array(
'search' => array(
":",
";",
"}",
"{",
"@",
"!",
",",
">",
"+",
"~",
"/",
"*",
".",
"=",
"#",
"\r",
"\n",
"\t",
" ",
),
'replace' => array(
"\\:",
"\\;",
"\\}",
"\\{",
"\\@",
"\\!",
"\\,",
"\\>",
"\\+",
"\\~",
"\\/",
"\\*",
"\\.",
"\\=",
"\\#",
"\\r",
"\\n",
"\\t",
"\\ ",
),
);
/**
* Stash a reference to the controller on each instantiation
*
* @param (class) control: CSSCompression Controller
*/
public function __construct( CSSCompression_Control $control ) {
$this->Control = $control;
$this->options = &$control->Option->options;
}
/**
* Central trim handler
*
* @param (string) css: Stylesheet to trim
*/
public function trim( $css ) {
$css = $this->comments( $css );
$css = $this->escape( $css );
$css = $this->strip( $css );
return $css;
}
/**
* Does a quick run through the script to remove all comments from the sheet,
*
* @param (string) css: Stylesheet to trim
*/
private function comments( $css ) {
$pos = 0;
while ( preg_match( $this->rcmark, $css, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
switch ( $match[ 1 ][ 0 ] ) {
// Start of comment block
case "/*":
if ( preg_match( $this->rendcomment, $css, $m, PREG_OFFSET_CAPTURE, $match[ 1 ][ 1 ] + 1 ) ) {
$end = $m[ 0 ][ 1 ] - $match[ 1 ][ 1 ] + strlen( $m[ 0 ][ 0 ] );
$css = substr_replace( $css, '', $match[ 1 ][ 1 ], $end );
$pos = $match[ 0 ][ 1 ];
}
else {
$css = substr( $css, 0, $match[ 1 ][ 1 ] );
break 2;
}
break;
// Start of string
case "\"":
if ( preg_match( $this->rendquote, $css, $m, PREG_OFFSET_CAPTURE, $match[ 1 ][ 1 ] + 1 ) ) {
$pos = $m[ 0 ][ 1 ] + strlen( $m[ 0 ][ 0 ] );
}
else {
break 2;
}
break;
// Start of string
case "'":
if ( preg_match( $this->rendsinglequote, $css, $m, PREG_OFFSET_CAPTURE, $match[ 1 ][ 1 ] + 1 ) ) {
$pos = $m[ 0 ][ 1 ] + strlen( $m[ 0 ][ 0 ] );
}
else {
break 2;
}
break;
// Should have never gotten here
default:
break 2;
}
}
return $css;
}
/**
* Escape out possible splitter characters within urls
*
* @param (string) css: Full stylesheet
*/
private function escape( $css ) {
foreach ( $this->rescape as $regex ) {
$start = 0;
while ( preg_match( $regex, $css, $match, PREG_OFFSET_CAPTURE, $start ) ) {
$value = $match[ 1 ][ 0 ]
. str_replace( $this->escaped['search'], $this->escaped['replace'], $match[ 2 ][ 0 ] )
. $match[ 3 ][ 0 ];
$css = substr_replace( $css, $value, $match[ 0 ][ 1 ], strlen( $match[ 0 ][ 0 ] ) );
$start = $match[ 0 ][ 1 ] + strlen( $value ) + 1;
}
}
return $css;
}
/**
* Runs initial formatting to setup for compression
*
* @param (string) css: CSS Contents
*/
private function strip( $css ) {
// Run replacements
return trim( preg_replace( $this->trimmings['patterns'], $this->trimmings['replacements'], $css ) );
}
/**
* Access to private methods for testing
*
* @param (string) method: Method to be called
* @param (array) args: Array of paramters to be passed in
*/
public function access( $method, $args ) {
if ( method_exists( $this, $method ) ) {
return call_user_func_array( array( $this, $method ), $args );
}
else {
throw new CSSCompression_Exception( "Unknown method in Trim Class - " . $method );
}
}
};
?>

Binary file not shown.

Binary file not shown.

View File

@@ -1,21 +0,0 @@
Copyright (C) 2001-2010 Cosmin Truta.
This software is provided 'as-is', without any express or implied
warranty. In no event will the author(s) be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.

Binary file not shown.

View File

@@ -1,25 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<!-- Read this: www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html -->
<!-- Most restrictive policy: -->
<site-control permitted-cross-domain-policies="none"/>
<!-- Least restrictive policy: -->
<!--
<site-control permitted-cross-domain-policies="all"/>
<allow-access-from domain="*" to-ports="*" secure="false"/>
<allow-http-request-headers-from domain="*" headers="*" secure="false"/>
-->
<!--
If you host a crossdomain.xml file with allow-access-from domain=“*”
and dont understand all of the points described here, you probably
have a nasty security vulnerability. ~ simon willison
-->
</cross-domain-policy>

View File

@@ -1,8 +0,0 @@
* {
float: none; /* Screens are not big enough to account for floats */
background: #fff; /* As much contrast as possible */
color: #000;
}
/* Slightly reducing font size to reduce need to scroll */
body { font-size: 80%; }

View File

@@ -1,261 +0,0 @@
/**
* HTML5 ✰ Boilerplate
*
* style.css contains a reset, font normalization and some base styles.
*
* Credit is left where credit is due.
* Much inspiration was taken from these projects:
* - yui.yahooapis.com/2.8.1/build/base/base.css
* - camendesign.com/design/
* - praegnanz.de/weblog/htmlcssjs-kickstart
*/
/**
* html5doctor.com Reset Stylesheet (Eric Meyer's Reset Reloaded + HTML5 baseline)
* v1.6.1 2010-09-17 | Authors: Eric Meyer & Richard Clark
* html5doctor.com/html-5-reset-stylesheet/
*/
html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp,
small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, figcaption, figure,
footer, header, hgroup, menu, nav, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
blockquote, q { quotes: none; }
blockquote:before, blockquote:after,
q:before, q:after { content: ''; content: none; }
ins { background-color: #ff9; color: #000; text-decoration: none; }
mark { background-color: #ff9; color: #000; font-style: italic; font-weight: bold; }
del { text-decoration: line-through; }
abbr[title], dfn[title] { border-bottom: 1px dotted; cursor: help; }
table { border-collapse: collapse; border-spacing: 0; }
hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0; }
input, select { vertical-align: middle; }
/**
* Font normalization inspired by YUI Library's fonts.css: developer.yahoo.com/yui/
*/
body { font:13px/1.231 sans-serif; *font-size:small; } /* Hack retained to preserve specificity */
select, input, textarea, button { font:99% sans-serif; }
/* Normalize monospace sizing:
en.wikipedia.org/wiki/MediaWiki_talk:Common.css/Archive_11#Teletype_style_fix_for_Chrome */
pre, code, kbd, samp { font-family: monospace, sans-serif; }
/**
* Minimal base styles.
*/
/* Always force a scrollbar in non-IE */
html { overflow-y: scroll; }
/* Accessible focus treatment: people.opera.com/patrickl/experiments/keyboard/test */
a:hover, a:active { outline: none; }
ul, ol { margin-left: 2em; }
ol { list-style-type: decimal; }
/* Remove margins for navigation lists */
nav ul, nav li { margin: 0; list-style:none; list-style-image: none; }
small { font-size: 85%; }
strong, th { font-weight: bold; }
td { vertical-align: top; }
/* Set sub, sup without affecting line-height: gist.github.com/413930 */
sub, sup { font-size: 75%; line-height: 0; position: relative; }
sup { top: -0.5em; }
sub { bottom: -0.25em; }
pre {
/* www.pathf.com/blogs/2008/05/formatting-quoted-code-in-blog-posts-css21-white-space-pre-wrap/ */
white-space: pre; white-space: pre-wrap; word-wrap: break-word;
padding: 15px;
}
textarea { overflow: auto; } /* www.sitepoint.com/blogs/2010/08/20/ie-remove-textarea-scrollbars/ */
.ie6 legend, .ie7 legend { margin-left: -7px; }
/* Align checkboxes, radios, text inputs with their label by: Thierry Koblentz tjkdesign.com/ez-css/css/base.css */
input[type="radio"] { vertical-align: text-bottom; }
input[type="checkbox"] { vertical-align: bottom; }
.ie7 input[type="checkbox"] { vertical-align: baseline; }
.ie6 input { vertical-align: text-bottom; }
/* Hand cursor on clickable input elements */
label, input[type="button"], input[type="submit"], input[type="image"], button { cursor: pointer; }
/* Webkit browsers add a 2px margin outside the chrome of form elements */
button, input, select, textarea { margin: 0; }
/* Colors for form validity */
input:valid, textarea:valid { }
input:invalid, textarea:invalid {
border-radius: 1px; -moz-box-shadow: 0px 0px 5px red; -webkit-box-shadow: 0px 0px 5px red; box-shadow: 0px 0px 5px red;
}
.no-boxshadow input:invalid, .no-boxshadow textarea:invalid { background-color: #f0dddd; }
/* These selection declarations have to be separate
No text-shadow: twitter.com/miketaylr/status/12228805301
Also: hot pink! */
::-moz-selection{ background: #FF5E99; color:#fff; text-shadow: none; }
::selection { background:#FF5E99; color:#fff; text-shadow: none; }
/* j.mp/webkit-tap-highlight-color */
a:link { -webkit-tap-highlight-color: #FF5E99; }
/* Make buttons play nice in IE:
www.viget.com/inspire/styling-the-button-element-in-internet-explorer/ */
button { width: auto; overflow: visible; }
/* Bicubic resizing for non-native sized IMG:
code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/ */
.ie7 img { -ms-interpolation-mode: bicubic; }
/**
* You might tweak these..
*/
body, select, input, textarea {
/* #444 looks better than black: twitter.com/H_FJ/statuses/11800719859 */
color: #444;
/* Set your base font here, to apply evenly */
/* font-family: Georgia, serif; */
}
/* Headers (h1, h2, etc) have no default font-size or margin; define those yourself */
h1, h2, h3, h4, h5, h6 { font-weight: bold; }
a, a:active, a:visited { color: #607890; }
a:hover { color: #036; }
/**
* Primary styles
*
* Author:
*/
/**
* Non-semantic helper classes: please define your styles before this section.
*/
/* For image replacement */
.ir { display: block; text-indent: -999em; overflow: hidden; background-repeat: no-repeat; text-align: left; direction: ltr; }
/* Hide for both screenreaders and browsers:
css-discuss.incutio.com/wiki/Screenreader_Visibility */
.hidden { display: none; visibility: hidden; }
/* Hide only visually, but have it available for screenreaders: by Jon Neal.
www.webaim.org/techniques/css/invisiblecontent/ & j.mp/visuallyhidden */
.visuallyhidden { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; }
/* Extends the .visuallyhidden class to allow the element to be focusable when navigated to via the keyboard: drupal.org/node/897638 */
.visuallyhidden.focusable:active,
.visuallyhidden.focusable:focus { clip: auto; height: auto; margin: 0; overflow: visible; position: static; width: auto; }
/* Hide visually and from screenreaders, but maintain layout */
.invisible { visibility: hidden; }
/* The Magnificent Clearfix: Updated to prevent margin-collapsing on child elements.
j.mp/bestclearfix */
.clearfix:before, .clearfix:after { content: "\0020"; display: block; height: 0; overflow: hidden; }
.clearfix:after { clear: both; }
/* Fix clearfix: blueprintcss.lighthouseapp.com/projects/15318/tickets/5-extra-margin-padding-bottom-of-page */
.clearfix { zoom: 1; }
/**
* Media queries for responsive design.
*
* These follow after primary styles so they will successfully override.
*/
@media all and (orientation:portrait) {
/* Style adjustments for portrait mode goes here */
}
@media all and (orientation:landscape) {
/* Style adjustments for landscape mode goes here */
}
/* Grade-A Mobile Browsers (Opera Mobile, Mobile Safari, Android Chrome)
consider this: www.cloudfour.com/css-media-query-for-mobile-is-fools-gold/ */
@media screen and (max-device-width: 480px) {
/* Uncomment if you don't want iOS and WinMobile to mobile-optimize the text for you: j.mp/textsizeadjust */
/* html { -webkit-text-size-adjust:none; -ms-text-size-adjust:none; } */
}
/**
* Print styles.
*
* Inlined to avoid required HTTP connection: www.phpied.com/delay-loading-your-print-css/
*/
@media print {
* { background: transparent !important; color: black !important; text-shadow: none !important; filter:none !important;
-ms-filter: none !important; } /* Black prints faster: sanbeiji.com/archives/953 */
a, a:visited { color: #444 !important; text-decoration: underline; }
a[href]:after { content: " (" attr(href) ")"; }
abbr[title]:after { content: " (" attr(title) ")"; }
.ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; } /* Don't show links for images, or javascript/internal links */
pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }
thead { display: table-header-group; } /* css-discuss.incutio.com/wiki/Printing_Tables */
tr, img { page-break-inside: avoid; }
@page { margin: 0.5cm; }
p, h2, h3 { orphans: 3; widows: 3; }
h2, h3{ page-break-after: avoid; }
}

13
dist/.editorconfig vendored Normal file
View File

@@ -0,0 +1,13 @@
# editorconfig.org
root = true
[*]
charset = utf-8
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false

1
dist/.gitattributes vendored Normal file
View File

@@ -0,0 +1 @@
* text=auto

2
dist/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
# Include your project-specific ignores in this file
# Read about how to use .gitignore: https://help.github.com/articles/ignoring-files

984
dist/.htaccess vendored Normal file
View File

@@ -0,0 +1,984 @@
# Apache Server Configs v2.14.0 | MIT License
# https://github.com/h5bp/server-configs-apache
# (!) Using `.htaccess` files slows down Apache, therefore, if you have
# access to the main server configuration file (which is usually called
# `httpd.conf`), you should add this logic there.
#
# https://httpd.apache.org/docs/current/howto/htaccess.html.
# ######################################################################
# # CROSS-ORIGIN #
# ######################################################################
# ----------------------------------------------------------------------
# | Cross-origin requests |
# ----------------------------------------------------------------------
# Allow cross-origin requests.
#
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS
# http://enable-cors.org/
# http://www.w3.org/TR/cors/
# <IfModule mod_headers.c>
# Header set Access-Control-Allow-Origin "*"
# </IfModule>
# ----------------------------------------------------------------------
# | Cross-origin images |
# ----------------------------------------------------------------------
# Send the CORS header for images when browsers request it.
#
# https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image
# https://blog.chromium.org/2011/07/using-cross-domain-images-in-webgl-and.html
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
<FilesMatch "\.(bmp|cur|gif|ico|jpe?g|png|svgz?|webp)$">
SetEnvIf Origin ":" IS_CORS
Header set Access-Control-Allow-Origin "*" env=IS_CORS
</FilesMatch>
</IfModule>
</IfModule>
# ----------------------------------------------------------------------
# | Cross-origin web fonts |
# ----------------------------------------------------------------------
# Allow cross-origin access to web fonts.
<IfModule mod_headers.c>
<FilesMatch "\.(eot|otf|tt[cf]|woff2?)$">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
</IfModule>
# ----------------------------------------------------------------------
# | Cross-origin resource timing |
# ----------------------------------------------------------------------
# Allow cross-origin access to the timing information for all resources.
#
# If a resource isn't served with a `Timing-Allow-Origin` header that
# would allow its timing information to be shared with the document,
# some of the attributes of the `PerformanceResourceTiming` object will
# be set to zero.
#
# http://www.w3.org/TR/resource-timing/
# http://www.stevesouders.com/blog/2014/08/21/resource-timing-practical-tips/
# <IfModule mod_headers.c>
# Header set Timing-Allow-Origin: "*"
# </IfModule>
# ######################################################################
# # ERRORS #
# ######################################################################
# ----------------------------------------------------------------------
# | Custom error messages/pages |
# ----------------------------------------------------------------------
# Customize what Apache returns to the client in case of an error.
# https://httpd.apache.org/docs/current/mod/core.html#errordocument
ErrorDocument 404 /404.html
# ----------------------------------------------------------------------
# | Error prevention |
# ----------------------------------------------------------------------
# Disable the pattern matching based on filenames.
#
# This setting prevents Apache from returning a 404 error as the result
# of a rewrite when the directory with the same name does not exist.
#
# https://httpd.apache.org/docs/current/content-negotiation.html#multiviews
Options -MultiViews
# ######################################################################
# # INTERNET EXPLORER #
# ######################################################################
# ----------------------------------------------------------------------
# | Document modes |
# ----------------------------------------------------------------------
# Force Internet Explorer 8/9/10 to render pages in the highest mode
# available in the various cases when it may not.
#
# https://hsivonen.fi/doctype/#ie8
#
# (!) Starting with Internet Explorer 11, document modes are deprecated.
# If your business still relies on older web apps and services that were
# designed for older versions of Internet Explorer, you might want to
# consider enabling `Enterprise Mode` throughout your company.
#
# https://msdn.microsoft.com/en-us/library/ie/bg182625.aspx#docmode
# http://blogs.msdn.com/b/ie/archive/2014/04/02/stay-up-to-date-with-enterprise-mode-for-internet-explorer-11.aspx
<IfModule mod_headers.c>
Header set X-UA-Compatible "IE=edge"
# `mod_headers` cannot match based on the content-type, however,
# the `X-UA-Compatible` response header should be send only for
# HTML documents and not for the other resources.
<FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
Header unset X-UA-Compatible
</FilesMatch>
</IfModule>
# ----------------------------------------------------------------------
# | Iframes cookies |
# ----------------------------------------------------------------------
# Allow cookies to be set from iframes in Internet Explorer.
#
# https://msdn.microsoft.com/en-us/library/ms537343.aspx
# http://www.w3.org/TR/2000/CR-P3P-20001215/
# <IfModule mod_headers.c>
# Header set P3P "policyref=\"/w3c/p3p.xml\", CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\""
# </IfModule>
# ######################################################################
# # MEDIA TYPES AND CHARACTER ENCODINGS #
# ######################################################################
# ----------------------------------------------------------------------
# | Media types |
# ----------------------------------------------------------------------
# Serve resources with the proper media types (f.k.a. MIME types).
#
# https://www.iana.org/assignments/media-types/media-types.xhtml
# https://httpd.apache.org/docs/current/mod/mod_mime.html#addtype
<IfModule mod_mime.c>
# Data interchange
AddType application/atom+xml atom
AddType application/json json map topojson
AddType application/ld+json jsonld
AddType application/rss+xml rss
AddType application/vnd.geo+json geojson
AddType application/xml rdf xml
# JavaScript
# Normalize to standard type.
# https://tools.ietf.org/html/rfc4329#section-7.2
AddType application/javascript js
# Manifest files
AddType application/manifest+json webmanifest
AddType application/x-web-app-manifest+json webapp
AddType text/cache-manifest appcache
# Media files
AddType audio/mp4 f4a f4b m4a
AddType audio/ogg oga ogg opus
AddType image/bmp bmp
AddType image/svg+xml svg svgz
AddType image/webp webp
AddType video/mp4 f4v f4p m4v mp4
AddType video/ogg ogv
AddType video/webm webm
AddType video/x-flv flv
# Serving `.ico` image files with a different media type
# prevents Internet Explorer from displaying then as images:
# https://github.com/h5bp/html5-boilerplate/commit/37b5fec090d00f38de64b591bcddcb205aadf8ee
AddType image/x-icon cur ico
# Web fonts
AddType application/font-woff woff
AddType application/font-woff2 woff2
AddType application/vnd.ms-fontobject eot
# Browsers usually ignore the font media types and simply sniff
# the bytes to figure out the font type.
# https://mimesniff.spec.whatwg.org/#matching-a-font-type-pattern
#
# However, Blink and WebKit based browsers will show a warning
# in the console if the following font types are served with any
# other media types.
AddType application/x-font-ttf ttc ttf
AddType font/opentype otf
# Other
AddType application/octet-stream safariextz
AddType application/x-bb-appworld bbaw
AddType application/x-chrome-extension crx
AddType application/x-opera-extension oex
AddType application/x-xpinstall xpi
AddType text/vcard vcard vcf
AddType text/vnd.rim.location.xloc xloc
AddType text/vtt vtt
AddType text/x-component htc
</IfModule>
# ----------------------------------------------------------------------
# | Character encodings |
# ----------------------------------------------------------------------
# Serve all resources labeled as `text/html` or `text/plain`
# with the media type `charset` parameter set to `UTF-8`.
#
# https://httpd.apache.org/docs/current/mod/core.html#adddefaultcharset
AddDefaultCharset utf-8
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Serve the following file types with the media type `charset`
# parameter set to `UTF-8`.
#
# https://httpd.apache.org/docs/current/mod/mod_mime.html#addcharset
<IfModule mod_mime.c>
AddCharset utf-8 .atom \
.bbaw \
.css \
.geojson \
.js \
.json \
.jsonld \
.manifest \
.rdf \
.rss \
.topojson \
.vtt \
.webapp \
.webmanifest \
.xloc \
.xml
</IfModule>
# ######################################################################
# # REWRITES #
# ######################################################################
# ----------------------------------------------------------------------
# | Rewrite engine |
# ----------------------------------------------------------------------
# (1) Turn on the rewrite engine (this is necessary in order for
# the `RewriteRule` directives to work).
#
# https://httpd.apache.org/docs/current/mod/mod_rewrite.html#RewriteEngine
#
# (2) Enable the `FollowSymLinks` option if it isn't already.
#
# https://httpd.apache.org/docs/current/mod/core.html#options
#
# (3) If your web host doesn't allow the `FollowSymlinks` option,
# you need to comment it out or remove it, and then uncomment
# the `Options +SymLinksIfOwnerMatch` line (4), but be aware
# of the performance impact.
#
# https://httpd.apache.org/docs/current/misc/perf-tuning.html#symlinks
#
# (4) Some cloud hosting services will require you set `RewriteBase`.
#
# https://www.rackspace.com/knowledge_center/frequently-asked-question/why-is-modrewrite-not-working-on-my-site
# https://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritebase
#
# (5) Depending on how your server is set up, you may also need to
# use the `RewriteOptions` directive to enable some options for
# the rewrite engine.
#
# https://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewriteoptions
#
# (6) Set %{ENV:PROTO} variable, to allow rewrites to redirect with the
# appropriate schema automatically (http or https).
<IfModule mod_rewrite.c>
# (1)
RewriteEngine On
# (2)
Options +FollowSymlinks
# (3)
# Options +SymLinksIfOwnerMatch
# (4)
# RewriteBase /
# (5)
# RewriteOptions <options>
# (6)
RewriteCond %{HTTPS} =on
RewriteRule ^ - [env=proto:https]
RewriteCond %{HTTPS} !=on
RewriteRule ^ - [env=proto:http]
</IfModule>
# ----------------------------------------------------------------------
# | Forcing `https://` |
# ----------------------------------------------------------------------
# Redirect from the `http://` to the `https://` version of the URL.
# https://wiki.apache.org/httpd/RewriteHTTPToHTTPS
# <IfModule mod_rewrite.c>
# RewriteEngine On
# RewriteCond %{HTTPS} !=on
# RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
# </IfModule>
# ----------------------------------------------------------------------
# | Suppressing / Forcing the `www.` at the beginning of URLs |
# ----------------------------------------------------------------------
# The same content should never be available under two different
# URLs, especially not with and without `www.` at the beginning.
# This can cause SEO problems (duplicate content), and therefore,
# you should choose one of the alternatives and redirect the other
# one.
#
# By default `Option 1` (no `www.`) is activated.
# http://no-www.org/faq.php?q=class_b
#
# If you would prefer to use `Option 2`, just comment out all the
# lines from `Option 1` and uncomment the ones from `Option 2`.
#
# (!) NEVER USE BOTH RULES AT THE SAME TIME!
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Option 1: rewrite www.example.com → example.com
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ %{ENV:PROTO}://%1%{REQUEST_URI} [R=301,L]
</IfModule>
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Option 2: rewrite example.com → www.example.com
#
# Be aware that the following might not be a good idea if you use "real"
# subdomains for certain parts of your website.
# <IfModule mod_rewrite.c>
# RewriteEngine On
# RewriteCond %{HTTPS} !=on
# RewriteCond %{HTTP_HOST} !^www\. [NC]
# RewriteCond %{SERVER_ADDR} !=127.0.0.1
# RewriteCond %{SERVER_ADDR} !=::1
# RewriteRule ^ %{ENV:PROTO}://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
# </IfModule>
# ######################################################################
# # SECURITY #
# ######################################################################
# ----------------------------------------------------------------------
# | Clickjacking |
# ----------------------------------------------------------------------
# Protect website against clickjacking.
#
# The example below sends the `X-Frame-Options` response header with
# the value `DENY`, informing browsers not to display the content of
# the web page in any frame.
#
# This might not be the best setting for everyone. You should read
# about the other two possible values the `X-Frame-Options` header
# field can have: `SAMEORIGIN` and `ALLOW-FROM`.
# https://tools.ietf.org/html/rfc7034#section-2.1.
#
# Keep in mind that while you could send the `X-Frame-Options` header
# for all of your websites pages, this has the potential downside that
# it forbids even non-malicious framing of your content (e.g.: when
# users visit your website using a Google Image Search results page).
#
# Nonetheless, you should ensure that you send the `X-Frame-Options`
# header for all pages that allow a user to make a state changing
# operation (e.g: pages that contain one-click purchase links, checkout
# or bank-transfer confirmation pages, pages that make permanent
# configuration changes, etc.).
#
# Sending the `X-Frame-Options` header can also protect your website
# against more than just clickjacking attacks:
# https://cure53.de/xfo-clickjacking.pdf.
#
# https://tools.ietf.org/html/rfc7034
# http://blogs.msdn.com/b/ieinternals/archive/2010/03/30/combating-clickjacking-with-x-frame-options.aspx
# https://www.owasp.org/index.php/Clickjacking
# <IfModule mod_headers.c>
# Header set X-Frame-Options "DENY"
# # `mod_headers` cannot match based on the content-type, however,
# # the `X-Frame-Options` response header should be send only for
# # HTML documents and not for the other resources.
# <FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
# Header unset X-Frame-Options
# </FilesMatch>
# </IfModule>
# ----------------------------------------------------------------------
# | Content Security Policy (CSP) |
# ----------------------------------------------------------------------
# Mitigate the risk of cross-site scripting and other content-injection
# attacks.
#
# This can be done by setting a `Content Security Policy` which
# whitelists trusted sources of content for your website.
#
# The example header below allows ONLY scripts that are loaded from
# the current website's origin (no inline scripts, no CDN, etc).
# That almost certainly won't work as-is for your website!
#
# To make things easier, you can use an online CSP header generator
# such as: http://cspisawesome.com/.
#
# http://content-security-policy.com/
# http://www.html5rocks.com/en/tutorials/security/content-security-policy/
# http://www.w3.org/TR/CSP11/).
# <IfModule mod_headers.c>
# Header set Content-Security-Policy "script-src 'self'; object-src 'self'"
# # `mod_headers` cannot match based on the content-type, however,
# # the `Content-Security-Policy` response header should be send
# # only for HTML documents and not for the other resources.
# <FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
# Header unset Content-Security-Policy
# </FilesMatch>
# </IfModule>
# ----------------------------------------------------------------------
# | File access |
# ----------------------------------------------------------------------
# Block access to directories without a default document.
#
# You should leave the following uncommented, as you shouldn't allow
# anyone to surf through every directory on your server (which may
# includes rather private places such as the CMS's directories).
<IfModule mod_autoindex.c>
Options -Indexes
</IfModule>
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Block access to all hidden files and directories with the exception of
# the visible content from within the `/.well-known/` hidden directory.
#
# These types of files usually contain user preferences or the preserved
# state of an utility, and can include rather private places like, for
# example, the `.git` or `.svn` directories.
#
# The `/.well-known/` directory represents the standard (RFC 5785) path
# prefix for "well-known locations" (e.g.: `/.well-known/manifest.json`,
# `/.well-known/keybase.txt`), and therefore, access to its visible
# content should not be blocked.
#
# https://www.mnot.net/blog/2010/04/07/well-known
# https://tools.ietf.org/html/rfc5785
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} "!(^|/)\.well-known/([^./]+./?)+$" [NC]
RewriteCond %{SCRIPT_FILENAME} -d [OR]
RewriteCond %{SCRIPT_FILENAME} -f
RewriteRule "(^|/)\." - [F]
</IfModule>
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Block access to files that can expose sensitive information.
#
# By default, block access to backup and source files that may be
# left by some text editors and can pose a security risk when anyone
# has access to them.
#
# http://feross.org/cmsploit/
#
# (!) Update the `<FilesMatch>` regular expression from below to
# include any files that might end up on your production server and
# can expose sensitive information about your website. These files may
# include: configuration files, files that contain metadata about the
# project (e.g.: project dependencies), build scripts, etc..
<FilesMatch "(^#.*#|\.(bak|conf|dist|fla|in[ci]|log|psd|sh|sql|sw[op])|~)$">
# Apache < 2.3
<IfModule !mod_authz_core.c>
Order allow,deny
Deny from all
Satisfy All
</IfModule>
# Apache ≥ 2.3
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
</FilesMatch>
# ----------------------------------------------------------------------
# | HTTP Strict Transport Security (HSTS) |
# ----------------------------------------------------------------------
# Force client-side SSL redirection.
#
# If a user types `example.com` in their browser, even if the server
# redirects them to the secure version of the website, that still leaves
# a window of opportunity (the initial HTTP connection) for an attacker
# to downgrade or redirect the request.
#
# The following header ensures that browser will ONLY connect to your
# server via HTTPS, regardless of what the users type in the browser's
# address bar.
#
# (!) Remove the `includeSubDomains` optional directive if the website's
# subdomains are not using HTTPS.
#
# http://www.html5rocks.com/en/tutorials/security/transport-layer-security/
# https://tools.ietf.org/html/draft-ietf-websec-strict-transport-sec-14#section-6.1
# http://blogs.msdn.com/b/ieinternals/archive/2014/08/18/hsts-strict-transport-security-attacks-mitigations-deployment-https.aspx
# <IfModule mod_headers.c>
# Header always set Strict-Transport-Security "max-age=16070400; includeSubDomains"
# </IfModule>
# ----------------------------------------------------------------------
# | Reducing MIME type security risks |
# ----------------------------------------------------------------------
# Prevent some browsers from MIME-sniffing the response.
#
# This reduces exposure to drive-by download attacks and cross-origin
# data leaks, and should be left uncommented, especially if the server
# is serving user-uploaded content or content that could potentially be
# treated as executable by the browser.
#
# http://www.slideshare.net/hasegawayosuke/owasp-hasegawa
# http://blogs.msdn.com/b/ie/archive/2008/07/02/ie8-security-part-v-comprehensive-protection.aspx
# https://msdn.microsoft.com/en-us/library/ie/gg622941.aspx
# https://mimesniff.spec.whatwg.org/
<IfModule mod_headers.c>
Header set X-Content-Type-Options "nosniff"
</IfModule>
# ----------------------------------------------------------------------
# | Reflected Cross-Site Scripting (XSS) attacks |
# ----------------------------------------------------------------------
# (1) Try to re-enable the cross-site scripting (XSS) filter built
# into most web browsers.
#
# The filter is usually enabled by default, but in some cases it
# may be disabled by the user. However, in Internet Explorer for
# example, it can be re-enabled just by sending the
# `X-XSS-Protection` header with the value of `1`.
#
# (2) Prevent web browsers from rendering the web page if a potential
# reflected (a.k.a non-persistent) XSS attack is detected by the
# filter.
#
# By default, if the filter is enabled and browsers detect a
# reflected XSS attack, they will attempt to block the attack
# by making the smallest possible modifications to the returned
# web page.
#
# Unfortunately, in some browsers (e.g.: Internet Explorer),
# this default behavior may allow the XSS filter to be exploited,
# thereby, it's better to inform browsers to prevent the rendering
# of the page altogether, instead of attempting to modify it.
#
# https://hackademix.net/2009/11/21/ies-xss-filter-creates-xss-vulnerabilities
#
# (!) Do not rely on the XSS filter to prevent XSS attacks! Ensure that
# you are taking all possible measures to prevent XSS attacks, the
# most obvious being: validating and sanitizing your website's inputs.
#
# http://blogs.msdn.com/b/ie/archive/2008/07/02/ie8-security-part-iv-the-xss-filter.aspx
# http://blogs.msdn.com/b/ieinternals/archive/2011/01/31/controlling-the-internet-explorer-xss-filter-with-the-x-xss-protection-http-header.aspx
# https://www.owasp.org/index.php/Cross-site_Scripting_%28XSS%29
# <IfModule mod_headers.c>
# # (1) (2)
# Header set X-XSS-Protection "1; mode=block"
# # `mod_headers` cannot match based on the content-type, however,
# # the `X-XSS-Protection` response header should be send only for
# # HTML documents and not for the other resources.
# <FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
# Header unset X-XSS-Protection
# </FilesMatch>
# </IfModule>
# ----------------------------------------------------------------------
# | Server-side technology information |
# ----------------------------------------------------------------------
# Remove the `X-Powered-By` response header that:
#
# * is set by some frameworks and server-side languages
# (e.g.: ASP.NET, PHP), and its value contains information
# about them (e.g.: their name, version number)
#
# * doesn't provide any value as far as users are concern,
# and in some cases, the information provided by it can
# be used by attackers
#
# (!) If you can, you should disable the `X-Powered-By` header from the
# language / framework level (e.g.: for PHP, you can do that by setting
# `expose_php = off` in `php.ini`)
#
# https://php.net/manual/en/ini.core.php#ini.expose-php
<IfModule mod_headers.c>
Header unset X-Powered-By
</IfModule>
# ----------------------------------------------------------------------
# | Server software information |
# ----------------------------------------------------------------------
# Prevent Apache from adding a trailing footer line containing
# information about the server to the server-generated documents
# (e.g.: error messages, directory listings, etc.)
#
# https://httpd.apache.org/docs/current/mod/core.html#serversignature
ServerSignature Off
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Prevent Apache from sending in the `Server` response header its
# exact version number, the description of the generic OS-type or
# information about its compiled-in modules.
#
# (!) The `ServerTokens` directive will only work in the main server
# configuration file, so don't try to enable it in the `.htaccess` file!
#
# https://httpd.apache.org/docs/current/mod/core.html#servertokens
#ServerTokens Prod
# ######################################################################
# # WEB PERFORMANCE #
# ######################################################################
# ----------------------------------------------------------------------
# | Compression |
# ----------------------------------------------------------------------
<IfModule mod_deflate.c>
# Force compression for mangled `Accept-Encoding` request headers
# https://developer.yahoo.com/blogs/ydn/pushing-beyond-gzipping-25601.html
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
</IfModule>
</IfModule>
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Compress all output labeled with one of the following media types.
#
# (!) For Apache versions below version 2.3.7 you don't need to
# enable `mod_filter` and can remove the `<IfModule mod_filter.c>`
# and `</IfModule>` lines as `AddOutputFilterByType` is still in
# the core directives.
#
# https://httpd.apache.org/docs/current/mod/mod_filter.html#addoutputfilterbytype
<IfModule mod_filter.c>
AddOutputFilterByType DEFLATE "application/atom+xml" \
"application/javascript" \
"application/json" \
"application/ld+json" \
"application/manifest+json" \
"application/rdf+xml" \
"application/rss+xml" \
"application/schema+json" \
"application/vnd.geo+json" \
"application/vnd.ms-fontobject" \
"application/x-font-ttf" \
"application/x-javascript" \
"application/x-web-app-manifest+json" \
"application/xhtml+xml" \
"application/xml" \
"font/eot" \
"font/opentype" \
"image/bmp" \
"image/svg+xml" \
"image/vnd.microsoft.icon" \
"image/x-icon" \
"text/cache-manifest" \
"text/css" \
"text/html" \
"text/javascript" \
"text/plain" \
"text/vcard" \
"text/vnd.rim.location.xloc" \
"text/vtt" \
"text/x-component" \
"text/x-cross-domain-policy" \
"text/xml"
</IfModule>
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Map the following filename extensions to the specified
# encoding type in order to make Apache serve the file types
# with the appropriate `Content-Encoding` response header
# (do note that this will NOT make Apache compress them!).
#
# If these files types would be served without an appropriate
# `Content-Enable` response header, client applications (e.g.:
# browsers) wouldn't know that they first need to uncompress
# the response, and thus, wouldn't be able to understand the
# content.
#
# https://httpd.apache.org/docs/current/mod/mod_mime.html#addencoding
<IfModule mod_mime.c>
AddEncoding gzip svgz
</IfModule>
</IfModule>
# ----------------------------------------------------------------------
# | Content transformation |
# ----------------------------------------------------------------------
# Prevent intermediate caches or proxies (e.g.: such as the ones
# used by mobile network providers) from modifying the website's
# content.
#
# https://tools.ietf.org/html/rfc2616#section-14.9.5
#
# (!) If you are using `mod_pagespeed`, please note that setting
# the `Cache-Control: no-transform` response header will prevent
# `PageSpeed` from rewriting `HTML` files, and, if the
# `ModPagespeedDisableRewriteOnNoTransform` directive isn't set
# to `off`, also from rewriting other resources.
#
# https://developers.google.com/speed/pagespeed/module/configuration#notransform
# <IfModule mod_headers.c>
# Header merge Cache-Control "no-transform"
# </IfModule>
# ----------------------------------------------------------------------
# | ETags |
# ----------------------------------------------------------------------
# Remove `ETags` as resources are sent with far-future expires headers.
#
# https://developer.yahoo.com/performance/rules.html#etags
# https://tools.ietf.org/html/rfc7232#section-2.3
# `FileETag None` doesn't work in all cases.
<IfModule mod_headers.c>
Header unset ETag
</IfModule>
FileETag None
# ----------------------------------------------------------------------
# | Expires headers |
# ----------------------------------------------------------------------
# Serve resources with far-future expires headers.
#
# (!) If you don't control versioning with filename-based
# cache busting, you should consider lowering the cache times
# to something like one week.
#
# https://httpd.apache.org/docs/current/mod/mod_expires.html
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 1 month"
# CSS
ExpiresByType text/css "access plus 1 year"
# Data interchange
ExpiresByType application/atom+xml "access plus 1 hour"
ExpiresByType application/rdf+xml "access plus 1 hour"
ExpiresByType application/rss+xml "access plus 1 hour"
ExpiresByType application/json "access plus 0 seconds"
ExpiresByType application/ld+json "access plus 0 seconds"
ExpiresByType application/schema+json "access plus 0 seconds"
ExpiresByType application/vnd.geo+json "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType text/xml "access plus 0 seconds"
# Favicon (cannot be renamed!) and cursor images
ExpiresByType image/vnd.microsoft.icon "access plus 1 week"
ExpiresByType image/x-icon "access plus 1 week"
# HTML
ExpiresByType text/html "access plus 0 seconds"
# JavaScript
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType application/x-javascript "access plus 1 year"
ExpiresByType text/javascript "access plus 1 year"
# Manifest files
ExpiresByType application/manifest+json "access plus 1 week"
ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds"
ExpiresByType text/cache-manifest "access plus 0 seconds"
# Media files
ExpiresByType audio/ogg "access plus 1 month"
ExpiresByType image/bmp "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
ExpiresByType image/webp "access plus 1 month"
ExpiresByType video/mp4 "access plus 1 month"
ExpiresByType video/ogg "access plus 1 month"
ExpiresByType video/webm "access plus 1 month"
# Web fonts
# Embedded OpenType (EOT)
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
ExpiresByType font/eot "access plus 1 month"
# OpenType
ExpiresByType font/opentype "access plus 1 month"
# TrueType
ExpiresByType application/x-font-ttf "access plus 1 month"
# Web Open Font Format (WOFF) 1.0
ExpiresByType application/font-woff "access plus 1 month"
ExpiresByType application/x-font-woff "access plus 1 month"
ExpiresByType font/woff "access plus 1 month"
# Web Open Font Format (WOFF) 2.0
ExpiresByType application/font-woff2 "access plus 1 month"
# Other
ExpiresByType text/x-cross-domain-policy "access plus 1 week"
</IfModule>
# ----------------------------------------------------------------------
# | File concatenation |
# ----------------------------------------------------------------------
# Allow concatenation from within specific files.
#
# e.g.:
#
# If you have the following lines in a file called, for
# example, `main.combined.js`:
#
# <!--#include file="js/jquery.js" -->
# <!--#include file="js/jquery.timer.js" -->
#
# Apache will replace those lines with the content of the
# specified files.
# <IfModule mod_include.c>
# <FilesMatch "\.combined\.js$">
# Options +Includes
# AddOutputFilterByType INCLUDES application/javascript \
# application/x-javascript \
# text/javascript
# SetOutputFilter INCLUDES
# </FilesMatch>
# <FilesMatch "\.combined\.css$">
# Options +Includes
# AddOutputFilterByType INCLUDES text/css
# SetOutputFilter INCLUDES
# </FilesMatch>
# </IfModule>
# ----------------------------------------------------------------------
# | Filename-based cache busting |
# ----------------------------------------------------------------------
# If you're not using a build process to manage your filename version
# revving, you might want to consider enabling the following directives
# to route all requests such as `/style.12345.css` to `/style.css`.
#
# To understand why this is important and even a better solution than
# using something like `*.css?v231`, please see:
# http://www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/
# <IfModule mod_rewrite.c>
# RewriteEngine On
# RewriteCond %{REQUEST_FILENAME} !-f
# RewriteRule ^(.+)\.(\d+)\.(bmp|css|cur|gif|ico|jpe?g|js|png|svgz?|webp|webmanifest)$ $1.$3 [L]
# </IfModule>

60
dist/404.html vendored Normal file
View File

@@ -0,0 +1,60 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Page Not Found</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
* {
line-height: 1.2;
margin: 0;
}
html {
color: #888;
display: table;
font-family: sans-serif;
height: 100%;
text-align: center;
width: 100%;
}
body {
display: table-cell;
vertical-align: middle;
margin: 2em auto;
}
h1 {
color: #555;
font-size: 2em;
font-weight: 400;
}
p {
margin: 0 auto;
width: 280px;
}
@media only screen and (max-width: 280px) {
body, p {
width: 95%;
}
h1 {
font-size: 1.5em;
margin: 0 0 0.3em;
}
}
</style>
</head>
<body>
<h1>Page Not Found</h1>
<p>Sorry, but the page you were trying to view does not exist.</p>
</body>
</html>
<!-- IE needs 512+ bytes: http://blogs.msdn.com/b/ieinternals/archive/2010/08/19/http-error-pages-in-internet-explorer.aspx -->

19
dist/LICENSE.txt vendored Normal file
View File

@@ -0,0 +1,19 @@
Copyright (c) HTML5 Boilerplate
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

BIN
dist/apple-touch-icon.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

12
dist/browserconfig.xml vendored Normal file
View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Please read: https://msdn.microsoft.com/en-us/library/ie/dn455106.aspx -->
<browserconfig>
<msapplication>
<tile>
<square70x70logo src="tile.png"/>
<square150x150logo src="tile.png"/>
<wide310x150logo src="tile-wide.png"/>
<square310x310logo src="tile.png"/>
</tile>
</msapplication>
</browserconfig>

15
dist/crossdomain.xml vendored Normal file
View File

@@ -0,0 +1,15 @@
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<!-- Read this: https://www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html -->
<!-- Most restrictive policy: -->
<site-control permitted-cross-domain-policies="none"/>
<!-- Least restrictive policy: -->
<!--
<site-control permitted-cross-domain-policies="all"/>
<allow-access-from domain="*" to-ports="*" secure="false"/>
<allow-http-request-headers-from domain="*" headers="*" secure="false"/>
-->
</cross-domain-policy>

280
dist/css/main.css vendored Normal file
View File

@@ -0,0 +1,280 @@
/*! HTML5 Boilerplate v5.2.0 | MIT License | https://html5boilerplate.com/ */
/*
* What follows is the result of much research on cross-browser styling.
* Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
* Kroc Camen, and the H5BP dev community and team.
*/
/* ==========================================================================
Base styles: opinionated defaults
========================================================================== */
html {
color: #222;
font-size: 1em;
line-height: 1.4;
}
/*
* Remove text-shadow in selection highlight:
* https://twitter.com/miketaylr/status/12228805301
*
* These selection rule sets have to be separate.
* Customize the background color to match your design.
*/
::-moz-selection {
background: #b3d4fc;
text-shadow: none;
}
::selection {
background: #b3d4fc;
text-shadow: none;
}
/*
* A better looking default horizontal rule
*/
hr {
display: block;
height: 1px;
border: 0;
border-top: 1px solid #ccc;
margin: 1em 0;
padding: 0;
}
/*
* Remove the gap between audio, canvas, iframes,
* images, videos and the bottom of their containers:
* https://github.com/h5bp/html5-boilerplate/issues/440
*/
audio,
canvas,
iframe,
img,
svg,
video {
vertical-align: middle;
}
/*
* Remove default fieldset styles.
*/
fieldset {
border: 0;
margin: 0;
padding: 0;
}
/*
* Allow only vertical resizing of textareas.
*/
textarea {
resize: vertical;
}
/* ==========================================================================
Browser Upgrade Prompt
========================================================================== */
.browserupgrade {
margin: 0.2em 0;
background: #ccc;
color: #000;
padding: 0.2em 0;
}
/* ==========================================================================
Author's custom styles
========================================================================== */
/* ==========================================================================
Helper classes
========================================================================== */
/*
* Hide visually and from screen readers:
*/
.hidden {
display: none !important;
}
/*
* Hide only visually, but have it available for screen readers:
* http://snook.ca/archives/html_and_css/hiding-content-for-accessibility
*/
.visuallyhidden {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
/*
* Extends the .visuallyhidden class to allow the element
* to be focusable when navigated to via the keyboard:
* https://www.drupal.org/node/897638
*/
.visuallyhidden.focusable:active,
.visuallyhidden.focusable:focus {
clip: auto;
height: auto;
margin: 0;
overflow: visible;
position: static;
width: auto;
}
/*
* Hide visually and from screen readers, but maintain layout
*/
.invisible {
visibility: hidden;
}
/*
* Clearfix: contain floats
*
* For modern browsers
* 1. The space content is one way to avoid an Opera bug when the
* `contenteditable` attribute is included anywhere else in the document.
* Otherwise it causes space to appear at the top and bottom of elements
* that receive the `clearfix` class.
* 2. The use of `table` rather than `block` is only necessary if using
* `:before` to contain the top-margins of child elements.
*/
.clearfix:before,
.clearfix:after {
content: " "; /* 1 */
display: table; /* 2 */
}
.clearfix:after {
clear: both;
}
/* ==========================================================================
EXAMPLE Media Queries for Responsive Design.
These examples override the primary ('mobile first') styles.
Modify as content requires.
========================================================================== */
@media only screen and (min-width: 35em) {
/* Style adjustments for viewports that meet the condition */
}
@media print,
(-webkit-min-device-pixel-ratio: 1.25),
(min-resolution: 1.25dppx),
(min-resolution: 120dpi) {
/* Style adjustments for high resolution devices */
}
/* ==========================================================================
Print styles.
Inlined to avoid the additional HTTP request:
http://www.phpied.com/delay-loading-your-print-css/
========================================================================== */
@media print {
*,
*:before,
*:after {
background: transparent !important;
color: #000 !important; /* Black prints faster:
http://www.sanbeiji.com/archives/953 */
box-shadow: none !important;
text-shadow: none !important;
}
a,
a:visited {
text-decoration: underline;
}
a[href]:after {
content: " (" attr(href) ")";
}
abbr[title]:after {
content: " (" attr(title) ")";
}
/*
* Don't show links that are fragment identifiers,
* or use the `javascript:` pseudo protocol
*/
a[href^="#"]:after,
a[href^="javascript:"]:after {
content: "";
}
pre,
blockquote {
border: 1px solid #999;
page-break-inside: avoid;
}
/*
* Printing Tables:
* http://css-discuss.incutio.com/wiki/Printing_Tables
*/
thead {
display: table-header-group;
}
tr,
img {
page-break-inside: avoid;
}
img {
max-width: 100% !important;
}
p,
h2,
h3 {
orphans: 3;
widows: 3;
}
h2,
h3 {
page-break-after: avoid;
}
}

424
dist/css/normalize.css vendored Normal file
View File

@@ -0,0 +1,424 @@
/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
/**
* 1. Set default font family to sans-serif.
* 2. Prevent iOS and IE text size adjust after device orientation change,
* without disabling user zoom.
*/
html {
font-family: sans-serif; /* 1 */
-ms-text-size-adjust: 100%; /* 2 */
-webkit-text-size-adjust: 100%; /* 2 */
}
/**
* Remove default margin.
*/
body {
margin: 0;
}
/* HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined for any HTML5 element in IE 8/9.
* Correct `block` display not defined for `details` or `summary` in IE 10/11
* and Firefox.
* Correct `block` display not defined for `main` in IE 11.
*/
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
menu,
nav,
section,
summary {
display: block;
}
/**
* 1. Correct `inline-block` display not defined in IE 8/9.
* 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.
*/
audio,
canvas,
progress,
video {
display: inline-block; /* 1 */
vertical-align: baseline; /* 2 */
}
/**
* Prevent modern browsers from displaying `audio` without controls.
* Remove excess height in iOS 5 devices.
*/
audio:not([controls]) {
display: none;
height: 0;
}
/**
* Address `[hidden]` styling not present in IE 8/9/10.
* Hide the `template` element in IE 8/9/10/11, Safari, and Firefox < 22.
*/
[hidden],
template {
display: none;
}
/* Links
========================================================================== */
/**
* Remove the gray background color from active links in IE 10.
*/
a {
background-color: transparent;
}
/**
* Improve readability of focused elements when they are also in an
* active/hover state.
*/
a:active,
a:hover {
outline: 0;
}
/* Text-level semantics
========================================================================== */
/**
* Address styling not present in IE 8/9/10/11, Safari, and Chrome.
*/
abbr[title] {
border-bottom: 1px dotted;
}
/**
* Address style set to `bolder` in Firefox 4+, Safari, and Chrome.
*/
b,
strong {
font-weight: bold;
}
/**
* Address styling not present in Safari and Chrome.
*/
dfn {
font-style: italic;
}
/**
* Address variable `h1` font-size and margin within `section` and `article`
* contexts in Firefox 4+, Safari, and Chrome.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/**
* Address styling not present in IE 8/9.
*/
mark {
background: #ff0;
color: #000;
}
/**
* Address inconsistent and variable font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` affecting `line-height` in all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
/* Embedded content
========================================================================== */
/**
* Remove border when inside `a` element in IE 8/9/10.
*/
img {
border: 0;
}
/**
* Correct overflow not hidden in IE 9/10/11.
*/
svg:not(:root) {
overflow: hidden;
}
/* Grouping content
========================================================================== */
/**
* Address margin not present in IE 8/9 and Safari.
*/
figure {
margin: 1em 40px;
}
/**
* Address differences between Firefox and other browsers.
*/
hr {
box-sizing: content-box;
height: 0;
}
/**
* Contain overflow in all browsers.
*/
pre {
overflow: auto;
}
/**
* Address odd `em`-unit font size rendering in all browsers.
*/
code,
kbd,
pre,
samp {
font-family: monospace, monospace;
font-size: 1em;
}
/* Forms
========================================================================== */
/**
* Known limitation: by default, Chrome and Safari on OS X allow very limited
* styling of `select`, unless a `border` property is set.
*/
/**
* 1. Correct color not being inherited.
* Known issue: affects color of disabled elements.
* 2. Correct font properties not being inherited.
* 3. Address margins set differently in Firefox 4+, Safari, and Chrome.
*/
button,
input,
optgroup,
select,
textarea {
color: inherit; /* 1 */
font: inherit; /* 2 */
margin: 0; /* 3 */
}
/**
* Address `overflow` set to `hidden` in IE 8/9/10/11.
*/
button {
overflow: visible;
}
/**
* Address inconsistent `text-transform` inheritance for `button` and `select`.
* All other form control elements do not inherit `text-transform` values.
* Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.
* Correct `select` style inheritance in Firefox.
*/
button,
select {
text-transform: none;
}
/**
* 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
* and `video` controls.
* 2. Correct inability to style clickable `input` types in iOS.
* 3. Improve usability and consistency of cursor style between image-type
* `input` and others.
*/
button,
html input[type="button"], /* 1 */
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button; /* 2 */
cursor: pointer; /* 3 */
}
/**
* Re-set default cursor for disabled elements.
*/
button[disabled],
html input[disabled] {
cursor: default;
}
/**
* Remove inner padding and border in Firefox 4+.
*/
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
/**
* Address Firefox 4+ setting `line-height` on `input` using `!important` in
* the UA stylesheet.
*/
input {
line-height: normal;
}
/**
* It's recommended that you don't attempt to style these elements.
* Firefox's implementation doesn't respect box-sizing, padding, or width.
*
* 1. Address box sizing set to `content-box` in IE 8/9/10.
* 2. Remove excess padding in IE 8/9/10.
*/
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
/**
* Fix the cursor style for Chrome's increment/decrement buttons. For certain
* `font-size` values of the `input`, it causes the cursor style of the
* decrement button to change from `default` to `text`.
*/
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Address `appearance` set to `searchfield` in Safari and Chrome.
* 2. Address `box-sizing` set to `border-box` in Safari and Chrome.
*/
input[type="search"] {
-webkit-appearance: textfield; /* 1 */
box-sizing: content-box; /* 2 */
}
/**
* Remove inner padding and search cancel button in Safari and Chrome on OS X.
* Safari (but not Chrome) clips the cancel button when the search input has
* padding (and `textfield` appearance).
*/
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* Define consistent border, margin, and padding.
*/
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
/**
* 1. Correct `color` not being inherited in IE 8/9/10/11.
* 2. Remove padding so people aren't caught out if they zero out fieldsets.
*/
legend {
border: 0; /* 1 */
padding: 0; /* 2 */
}
/**
* Remove default vertical scrollbar in IE 8/9/10/11.
*/
textarea {
overflow: auto;
}
/**
* Don't inherit the `font-weight` (applied by a rule above).
* NOTE: the default cannot safely be changed in Chrome and Safari on OS X.
*/
optgroup {
font-weight: bold;
}
/* Tables
========================================================================== */
/**
* Remove most spacing between table cells.
*/
table {
border-collapse: collapse;
border-spacing: 0;
}
td,
th {
padding: 0;
}

29
dist/doc/TOC.md vendored Normal file
View File

@@ -0,0 +1,29 @@
[HTML5 Boilerplate homepage](https://html5boilerplate.com)
## Getting started
* [Usage](usage.md) — Overview of the project contents.
* [FAQ](faq.md) — Frequently asked questions along with their answers.
## HTML5 Boilerplate core
* [HTML](html.md) — Guide to the default HTML.
* [CSS](css.md) — Guide to the default CSS.
* [JavaScript](js.md) — Guide to the default JavaScript.
* [Everything else](misc.md).
## Development
* [Extending and customizing HTML5 Boilerplate](extend.md) — Going further
with the boilerplate.
## Related projects
The [H5BP organization](https://github.com/h5bp) maintains several projects
that complement HTML5 Boilerplate, projects that can help you improve different
aspects of your website/web app (e.g.: the performance, security, etc.).
* [Server Configs](https://github.com/h5bp/server-configs) — Fast and
smart configurations for web servers such as Apache and Nginx.
* [Ant Build Script](https://github.com/h5bp/ant-build-script) — Apache
Ant based build script.

162
dist/doc/css.md vendored Normal file
View File

@@ -0,0 +1,162 @@
[HTML5 Boilerplate homepage](https://html5boilerplate.com) | [Documentation
table of contents](TOC.md)
# The CSS
HTML5 Boilerplate's CSS includes:
* [Normalize.css](#normalizecss)
* [Useful defaults](#useful-defaults)
* [Common helpers](#common-helpers)
* [Placeholder media queries](#media-queries)
* [Print styles](#print-styles)
This starting CSS does not rely on the presence of
[conditional class names](https://www.paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/),
[conditional style sheets](https://css-tricks.com/how-to-create-an-ie-only-stylesheet/),
or [Modernizr](http://modernizr.com/), and it is ready to use no matter what
your development preferences happen to be.
## Normalize.css
In order to make browsers render all elements more consistently and in line
with modern standards, we include
[Normalize.css](https://necolas.github.io/normalize.css/) — a modern, HTML5-ready
alternative to CSS resets.
As opposed to CSS resets, Normalize.css:
* targets only the styles that need normalizing
* preserves useful browser defaults rather than erasing them
* corrects bugs and common browser inconsistencies
* improves usability with subtle improvements
* doesn't clutter the debugging tools
* has better documentation
For more information about Normalize.css, please refer to its [project
page](https://necolas.github.com/normalize.css/), as well as this
[blog post](http://nicolasgallagher.com/about-normalize-css/).
## Useful defaults
Several base styles are included that build upon `Normalize.css`. These
styles:
* provide basic typography settings that improve text readability
* protect against unwanted `text-shadow` during text highlighting
* tweak the default alignment of some elements (e.g.: `img`, `video`,
`fieldset`, `textarea`)
* style the prompt that is displayed to users using an outdated browser
You are free and even encouraged to modify or add to these base styles as your
project requires.
## Common helpers
Along with the base styles, we also provide some commonly used helper classes.
#### `.hidden`
The `hidden` class can be added to any element that you want to hide visually
and from screen readers. It could be an element that will be populated and
displayed later, or an element you will hide with JavaScript.
#### `.visuallyhidden`
The `visuallyhidden` class can be added to any element that you want to hide
visually, while still have its content accessible to screen readers.
See also:
* [CSS in Action: Invisible Content Just for Screen Reader
Users](http://www.webaim.org/techniques/css/invisiblecontent/)
* [Hiding content for
accessibility](http://snook.ca/archives/html_and_css/hiding-content-for-accessibility)
* [HTML5 Boilerplate - Issue #194](https://github.com/h5bp/html5-boilerplate/issues/194/).
#### `.invisible`
The `invisible` class can be added to any element that you want to hide
visually and from screen readers, but without affecting the layout.
As opposed to the `hidden` class that effectively removes the element from the
layout, the `invisible` class will simply make the element invisible while
keeping it in the flow and not affecting the positioning of the surrounding
content.
__N.B.__ Try to stay away from, and don't use the classes specified above for
[keyword stuffing](https://en.wikipedia.org/wiki/Keyword_stuffing) as you will
harm your site's ranking!
#### `.clearfix`
The `clearfix` class can be added to any element to ensure that it always fully
contains its floated children.
Over the years there have been many variants of the clearfix hack, but currently,
we use the [micro clearfix](http://nicolasgallagher.com/micro-clearfix-hack/).
## Media Queries
HTML5 Boilerplate makes it easy for you to get started with a
[_mobile first_](http://www.lukew.com/presos/preso.asp?26) and [_responsive web
design_](http://www.alistapart.com/articles/responsive-web-design/) approach to
development. But it's worth remembering that there are [no silver
bullets](http://blog.cloudfour.com/css-media-query-for-mobile-is-fools-gold/).
We include placeholder media queries to help you build up your mobile styles for
wider viewports and high-resolution displays. It's recommended that you adapt
these media queries based on the content of your site rather than mirroring the
fixed dimensions of specific devices.
If you do not want to take the _mobile first_ approach, you can simply edit or
remove these placeholder media queries. One possibility would be to work from
wide viewports down, and use `max-width` media queries instead (e.g.:
`@media only screen and (max-width: 480px)`).
For more features that can help you in your mobile web development, take a look
into our [Mobile Boilerplate](https://github.com/h5bp/mobile-boilerplate).
## Print styles
Lastly, we provide some useful print styles that will optimize the printing
process, as well as make the printed pages easier to read.
At printing time, these styles will:
* strip all background colors, change the font color to black, and remove the
`text-shadow` — done in order to [help save printer ink and speed up the
printing process](http://www.sanbeiji.com/archives/953)
* underline and expand links to include the URL — done in order to allow users
to know where to refer to<br>
(exceptions to this are: the links that are
[fragment identifiers](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-href),
or use the
[`javascript:` pseudo protocol](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/void#JavaScript_URIs))
* expand abbreviations to include the full description — done in order to allow
users to know what the abbreviations stands for
* provide instructions on how browsers should break the content into pages and
on [orphans/widows](https://en.wikipedia.org/wiki/Widows_and_orphans), namely,
we instruct
[supporting browsers](https://en.wikipedia.org/wiki/Comparison_of_layout_engines_%28Cascading_Style_Sheets%29#Grammar_and_rules)
that they should:
* ensure the table header (`<thead>`) is [printed on each page spanned by the
table](http://css-discuss.incutio.com/wiki/Printing_Tables)
* prevent block quotations, preformatted text, images and table rows from
being split onto two different pages
* ensure that headings never appear on a different page than the text they
are associated with
* ensure that
[orphans and widows](https://en.wikipedia.org/wiki/Widows_and_orphans) do
[not appear on printed pages](https://css-tricks.com/almanac/properties/o/orphans/)
The print styles are included along with the other `css` to [avoid the
additional HTTP request](http://www.phpied.com/delay-loading-your-print-css/).
Also, they should always be included last, so that the other styles can be
overwritten.

663
dist/doc/extend.md vendored Normal file
View File

@@ -0,0 +1,663 @@
[HTML5 Boilerplate homepage](https://html5boilerplate.com) | [Documentation
table of contents](TOC.md)
# Extend and customise HTML5 Boilerplate
Here is some useful advice for how you can make your project with HTML5
Boilerplate even better. We don't want to include it all by default, as
not everything fits with everyone's needs.
* [App Stores](#app-stores)
* [DNS prefetching](#dns-prefetching)
* [Google Universal Analytics](#google-universal-analytics)
* [Internet Explorer](#internet-explorer)
* [Miscellaneous](#miscellaneous)
* [News Feeds](#news-feeds)
* [Search](#search)
* [Social Networks](#social-networks)
* [URLs](#urls)
* [Web Apps](#web-apps)
## App Stores
### Install a Chrome Web Store app
Users can install a Chrome app directly from your website, as long as
the app and site have been associated via Google's Webmaster Tools.
Read more on [Chrome Web Store's Inline Installation
docs](https://developer.chrome.com/webstore/inline_installation).
```html
<link rel="chrome-webstore-item" href="https://chrome.google.com/webstore/detail/APP_ID">
```
### Smart App Banners in iOS 6+ Safari
Stop bothering everyone with gross modals advertising your entry in the
App Store. Include the following [meta tag](https://developer.apple.com/library/IOS/documentation/AppleApplications/Reference/SafariWebContent/PromotingAppswithAppBanners/PromotingAppswithAppBanners.html#//apple_ref/doc/uid/TP40002051-CH6-SW2)
will unintrusively allow the user the option to download your iOS app,
or open it with some data about the user's current state on the website.
```html
<meta name="apple-itunes-app" content="app-id=APP_ID,app-argument=SOME_TEXT">
```
## DNS prefetching
In short, DNS Prefetching is a method of informing the browser of domain names
referenced on a site so that the client can resolve the DNS for those hosts,
cache them, and when it comes time to use them, have a faster turn around on
the request.
### Implicit prefetches
There is a lot of prefetching done for you automatically by the browser. When
the browser encounters an anchor in your html that does not share the same
domain name as the current location the browser requests, from the client OS,
the IP address for this new domain. The client first checks its cache and
then, lacking a cached copy, makes a request from a DNS server. These requests
happen in the background and are not meant to block the rendering of the
page.
The goal of this is that when the foreign IP address is finally needed it will
already be in the client cache and will not block the loading of the foreign
content. Fewer requests result in faster page load times. The perception of this
is increased on a mobile platform where DNS latency can be greater.
#### Disable implicit prefetching
```html
<meta http-equiv="x-dns-prefetch-control" content="off">
```
Even with X-DNS-Prefetch-Control meta tag (or http header) browsers will still
prefetch any explicit dns-prefetch links.
**_WARNING:_** THIS MAY MAKE YOUR SITE SLOWER IF YOU RELY ON RESOURCES FROM
FOREIGN DOMAINS.
### Explicit prefetches
Typically the browser only scans the HTML for foreign domains. If you have
resources that are outside of your HTML (a javascript request to a remote
server or a CDN that hosts content that may not be present on every page of
your site, for example) then you can queue up a domain name to be prefetched.
```html
<link rel="dns-prefetch" href="//example.com">
<link rel="dns-prefetch" href="https://ajax.googleapis.com">
```
You can use as many of these as you need, but it's best if they are all
immediately after the [Meta
Charset](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#attr-charset)
element (which should go right at the top of the `head`), so the browser can
act on them ASAP.
#### Common Prefetch Links
Amazon S3:
```html
<link rel="dns-prefetch" href="//s3.amazonaws.com">
```
Google APIs:
```html
<link rel="dns-prefetch" href="https://ajax.googleapis.com">
```
Microsoft Ajax Content Delivery Network:
```html
<link rel="dns-prefetch" href="//ajax.microsoft.com">
<link rel="dns-prefetch" href="//ajax.aspnetcdn.com">
```
### Further reading about DNS prefetching
* https://developer.mozilla.org/en-US/docs/Controlling_DNS_prefetching
* https://dev.chromium.org/developers/design-documents/dns-prefetching
* http://blogs.msdn.com/b/ie/archive/2011/03/17/internet-explorer-9-network-performance-improvements.aspx
* http://dayofjs.com/videos/22158462/web-browsers_alex-russel
## Google Universal Analytics
### More tracking settings
The [optimized Google Universal Analytics
snippet](https://mathiasbynens.be/notes/async-analytics-snippet#universal-analytics)
included with HTML5 Boilerplate includes something like this:
```js
ga('create', 'UA-XXXXX-X', 'auto'); ga('send', 'pageview');
```
To customize further, see Google's [Advanced
Setup](https://developers.google.com/analytics/devguides/collection/analyticsjs/advanced),
[Pageview](https://developers.google.com/analytics/devguides/collection/analyticsjs/pages),
and [Event](https://developers.google.com/analytics/devguides/collection/analyticsjs/events) Docs.
### Anonymize IP addresses
In some countries, no personal data may be transferred outside jurisdictions
that do not have similarly strict laws (i.e. from Germany to outside the EU).
Thus a webmaster using the Google Universal Analytics may have to ensure that
no personal (trackable) data is transferred to the US. You can do that with
[the `ga('set', 'anonymizeIp', true);`
parameter](https://developers.google.com/analytics/devguides/collection/analyticsjs/advanced#anonymizeip)
before sending any events/pageviews. In use it looks like this:
```js
ga('create', 'UA-XXXXX-X', 'auto');
ga('set', 'anonymizeIp', true);
ga('send', 'pageview');
```
### Track jQuery AJAX requests in Google Analytics
An article by @JangoSteve explains how to [track jQuery AJAX requests in Google
Analytics](http://www.alfajango.com/blog/track-jquery-ajax-requests-in-google-analytics/).
Add this to `plugins.js`:
```js
/*
* Log all jQuery AJAX requests to Google Analytics
* See: http://www.alfajango.com/blog/track-jquery-ajax-requests-in-google-analytics/
*/
if (typeof ga !== "undefined" && ga !== null) {
$(document).ajaxSend(function(event, xhr, settings){
ga('send', 'pageview', settings.url);
});
}
```
### Track JavaScript errors in Google Analytics
Add this function after `ga` is defined:
```js
(function(window){
var undefined,
link = function (href) {
var a = window.document.createElement('a');
a.href = href;
return a;
};
window.onerror = function (message, file, line, column) {
var host = link(file).hostname;
ga('send', {
'hitType': 'event',
'eventCategory': (host == window.location.hostname || host == undefined || host == '' ? '' : 'external ') + 'error',
'eventAction': message,
'eventLabel': (file + ' LINE: ' + line + (column ? ' COLUMN: ' + column : '')).trim(),
'nonInteraction': 1
});
};
}(window));
```
### Track page scroll
Add this function after `ga` is defined:
```js
$(function(){
var isDuplicateScrollEvent,
scrollTimeStart = new Date,
$window = $(window),
$document = $(document),
scrollPercent;
$window.scroll(function() {
scrollPercent = Math.round(100 * ($window.height() + $window.scrollTop())/$document.height());
if (scrollPercent > 90 && !isDuplicateScrollEvent) { //page scrolled to 90%
isDuplicateScrollEvent = 1;
ga('send', 'event', 'scroll',
'Window: ' + $window.height() + 'px; Document: ' + $document.height() + 'px; Time: ' + Math.round((new Date - scrollTimeStart )/1000,1) + 's'
);
}
});
});
```
## Internet Explorer
### Prompt users to switch to "Desktop Mode" in IE10 Metro
IE10 does not support plugins, such as Flash, in Metro mode. If
your site requires plugins, you can let users know that via the
`x-ua-compatible` meta element, which will prompt them to switch
to Desktop Mode.
```html
<meta http-equiv="x-ua-compatible" content="requiresActiveX=true">
```
Here's what it looks like alongside H5BP's default `x-ua-compatible`
values:
```html
<meta http-equiv="x-ua-compatible" content="ie=edge,requiresActiveX=true">
```
You can find more information in [Microsoft's IEBlog post about prompting for
plugin use in IE10 Metro
Mode](http://blogs.msdn.com/b/ie/archive/2012/01/31/web-sites-and-a-plug-in-free-web.aspx).
### IE Pinned Sites (IE9+)
Enabling your application for pinning will allow IE9 users to add it to their
Windows Taskbar and Start Menu. This comes with a range of new tools that you
can easily configure with the elements below. See more [documentation on IE9
Pinned Sites](https://msdn.microsoft.com/en-us/library/gg131029.aspx).
### Name the Pinned Site for Windows
Without this rule, Windows will use the page title as the name for your
application.
```html
<meta name="application-name" content="Sample Title">
```
### Give your Pinned Site a tooltip
You know — a tooltip. A little textbox that appears when the user holds their
mouse over your Pinned Site's icon.
```html
<meta name="msapplication-tooltip" content="A description of what this site does.">
```
### Set a default page for your Pinned Site
If the site should go to a specific URL when it is pinned (such as the
homepage), enter it here. One idea is to send it to a special URL so you can
track the number of pinned users, like so:
`http://www.example.com/index.html?pinned=true`
```html
<meta name="msapplication-starturl" content="http://www.example.com/index.html?pinned=true">
```
### Recolor IE's controls manually for a Pinned Site
IE9+ will automatically use the overall color of your Pinned Site's favicon to
shade its browser buttons. UNLESS you give it another color here. Only use
named colors (`red`) or hex colors (`#ff0000`).
```html
<meta name="msapplication-navbutton-color" content="#ff0000">
```
### Manually set the window size of a Pinned Site
If the site should open at a certain window size once pinned, you can specify
the dimensions here. It only supports static pixel dimensions. 800x600
minimum.
```html
<meta name="msapplication-window" content="width=800;height=600">
```
### Jump List "Tasks" for Pinned Sites
Add Jump List Tasks that will appear when the Pinned Site's icon gets a
right-click. Each Task goes to the specified URL, and gets its own mini icon
(essentially a favicon, a 16x16 .ICO). You can add as many of these as you
need.
```html
<meta name="msapplication-task" content="name=Task 1;action-uri=http://host/Page1.html;icon-uri=http://host/icon1.ico">
<meta name="msapplication-task" content="name=Task 2;action-uri=http://microsoft.com/Page2.html;icon-uri=http://host/icon2.ico">
```
### (Windows 8) High quality visuals for Pinned Sites
Windows 8 adds the ability for you to provide a PNG tile image and specify the
tile's background color. [Full details on the IE
blog](http://blogs.msdn.com/b/ie/archive/2012/06/08/high-quality-visuals-for-pinned-sites-in-windows-8.aspx).
* Create a 144x144 image of your site icon, filling all of the canvas, and
using a transparent background.
* Save this image as a 32-bit PNG and optimize it without reducing
colour-depth. It can be named whatever you want (e.g. `metro-tile.png`).
* To reference the tile and its color, add the HTML `meta` elements described
in the IE Blog post.
### (Windows 8) Badges for Pinned Sites
IE10 will poll an XML document for badge information to display on your app's
tile in the Start screen. The user will be able to receive these badge updates
even when your app isn't actively running. The badge's value can be a number,
or one of a predefined list of glyphs.
* [Tutorial on IEBlog with link to badge XML schema](http://blogs.msdn.com/b/ie/archive/2012/04/03/pinned-sites-in-windows-8.aspx)
* [Available badge values](https://msdn.microsoft.com/en-us/library/ie/br212849.aspx)
```html
<meta name="msapplication-badge" value="frequency=NUMBER_IN_MINUTES;polling-uri=http://www.example.com/path/to/file.xml">
```
### Disable link highlighting upon tap in IE10
Similar to [-webkit-tap-highlight-color](http://davidwalsh.name/mobile-highlight-color)
in iOS Safari. Unlike that CSS property, this is an HTML meta element, and its
value is boolean rather than a color. It's all or nothing.
```html
<meta name="msapplication-tap-highlight" content="no" />
```
You can read about this useful element and more techniques in
[Microsoft's documentation on adapting WebKit-oriented apps for IE10](https://blogs.windows.com/buildingapps/2012/11/15/adapting-your-webkit-optimized-site-for-internet-explorer-10/)
## Search
### Direct search spiders to your sitemap
[Learn how to make a sitemap](http://www.sitemaps.org/protocol.html)
```html
<link rel="sitemap" type="application/xml" title="Sitemap" href="/sitemap.xml">
```
### Hide pages from search engines
According to Heather Champ, former community manager at Flickr, you should not
allow search engines to index your "Contact Us" or "Complaints" page if you
value your sanity. This is an HTML-centric way of achieving that.
```html
<meta name="robots" content="noindex">
```
**_WARNING:_** DO NOT INCLUDE ON PAGES THAT SHOULD APPEAR IN SEARCH ENGINES.
### Firefox and IE Search Plugins
Sites with in-site search functionality should be strongly considered for a
browser search plugin. A "search plugin" is an XML file which defines how your
plugin behaves in the browser. [How to make a browser search
plugin](https://www.google.com/search?ie=UTF-8&q=how+to+make+browser+search+plugin).
```html
<link rel="search" title="" type="application/opensearchdescription+xml" href="">
```
## Miscellaneous
* Use [polyfills](https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-browser-Polyfills).
* Use [Microformats](http://microformats.org/wiki/Main_Page) (via
[microdata](http://microformats.org/wiki/microdata)) for optimum search
results
[visibility](http://googlewebmastercentral.blogspot.com/2009/05/introducing-rich-snippets.html).
* If you're building a web app you may want [native style momentum scrolling in
iOS 5+](http://www.johanbrook.com/articles/native-style-momentum-scrolling-to-arrive-in-ios-5/)
using `-webkit-overflow-scrolling: touch`.
* If you want to disable the translation prompt in Chrome or block Google
Translate from translating your web page, use [`<meta name="google"
value="notranslate">`](https://support.google.com/translate/?hl=en#2641276).
To disable translation for a particular section of the web page, add
[`class="notranslate"`](https://support.google.com/translate/?hl=en#2641276).
* If you want to disable the automatic detection and formatting of possible
phone numbers in Safari on iOS, use [`<meta name="format-detection"
content="telephone=no">`](https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html/#//apple_ref/doc/uid/TP40008193-SW5).
* Avoid development/stage websites "leaking" into SERPs (search engine results
page) by [implementing X-Robots-tag
headers](https://github.com/h5bp/html5-boilerplate/issues/804).
* Screen readers currently have less-than-stellar support for HTML5 but the JS
script [accessifyhtml5.js](https://github.com/yatil/accessifyhtml5.js) can
help increase accessibility by adding ARIA roles to HTML5 elements.
## News Feeds
### RSS
Have an RSS feed? Link to it here. Want to [learn how to write an RSS feed from
scratch](http://www.rssboard.org/rss-specification)?
```html
<link rel="alternate" type="application/rss+xml" title="RSS" href="/rss.xml">
```
### Atom
Atom is similar to RSS, and you might prefer to use it instead of or in
addition to it. [See what Atom's all
about](http://www.atomenabled.org/developers/syndication/).
```html
<link rel="alternate" type="application/atom+xml" title="Atom" href="/atom.xml">
```
### Pingbacks
Your server may be notified when another site links to yours. The href
attribute should contain the location of your pingback service.
```html
<link rel="pingback" href="">
```
* High-level explanation: https://codex.wordpress.org/Introduction_to_Blogging#Pingbacks
* Step-by-step example case: http://www.hixie.ch/specs/pingback/pingback-1.0#TOC5
* PHP pingback service: https://web.archive.org/web/20131211032834/http://blog.perplexedlabs.com/2009/07/15/xmlrpc-pingbacks-using-php/
## Social Networks
### Facebook Open Graph data
You can control the information that Facebook and others display when users
share your site. Below are just the most basic data points you might need. For
specific content types (including "website"), see [Facebook's built-in Open
Graph content
templates](https://developers.facebook.com/docs/opengraph/objects/builtin/).
Take full advantage of Facebook's support for complex data and activity by
following the [Open Graph
tutorial](https://developers.facebook.com/docs/opengraph/tutorial/).
```html
<meta property="og:title" content="">
<meta property="og:description" content="">
<meta property="og:image" content="">
```
### Twitter Cards
Twitter provides a snippet specification that serves a similar purpose to Open
Graph. In fact, Twitter will use Open Graph when Cards is not available. Note
that, as of this writing, Twitter requires that app developers activate Cards
on a per-domain basis. You can read more about the various snippet formats
and application process in the [official Twitter Cards
documentation](https://dev.twitter.com/docs/cards).
```html
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@site_account">
<meta name="twitter:creator" content="@individual_account">
<meta name="twitter:url" content="http://www.example.com/path/to/page.html">
<meta name="twitter:title" content="">
<meta name="twitter:description" content="">
<meta name="twitter:image" content="http://www.example.com/path/to/image.jpg">
```
## URLs
### Canonical URL
Signal to search engines and others "Use this URL for this page!" Useful when
parameters after a `#` or `?` is used to control the display state of a page.
`http://www.example.com/cart.html?shopping-cart-open=true` can be indexed as
the cleaner, more accurate `http://www.example.com/cart.html`.
```html
<link rel="canonical" href="">
```
### Official shortlink
Signal to the world "This is the shortened URL to use this page!" Poorly
supported at this time. Learn more by reading the [article about shortlinks on
the Microformats wiki](http://microformats.org/wiki/rel-shortlink).
```html
<link rel="shortlink" href="h5bp.com">
```
### Separate mobile URLs
If you use separate URLs for desktop and mobile users, you should consider
helping search engine algorithms better understand the configuration on your
web site.
This can be done by adding the following annotations in your HTML pages:
* on the desktop page, add the `link rel="alternate"` tag pointing to the
corresponding mobile URL, e.g.:
`<link rel="alternate" media="only screen and (max-width: 640px)" href="http://m.example.com/page.html" >`
* on the mobile page, add the `link rel="canonical"` tag pointing to the
corresponding desktop URL, e.g.:
`<link rel="canonical" href="http://www.example.com/page.html">`
For more information please see:
* https://developers.google.com/webmasters/smartphone-sites/details#separateurls
* https://developers.google.com/webmasters/smartphone-sites/feature-phones
## Web Apps
There are a couple of meta tags that provide information about a web app when
added to the Home Screen on iOS:
* Adding `apple-mobile-web-app-capable` will make your web app chrome-less and
provide the default iOS app view. You can control the color scheme of the
default view by adding `apple-mobile-web-app-status-bar-style`.
```html
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
```
* You can use `apple-mobile-web-app-title` to add a specific sites name for the
Home Screen icon. This works since iOS 6.
```html
<meta name="apple-mobile-web-app-title" content="">
```
For further information please read the [official
documentation](https://developer.apple.com/library/safari/#documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html)
on Apple's site.
### Apple Touch Icons
The Apple touch icons can be seen as the favicons of iOS devices.
The main sizes of the Apple touch icons are:
* `57×57px` iPhone with @1x display and iPod Touch
* `72×72px` iPad and iPad mini with @1x display running iOS ≤ 6
* `76×76px` iPad and iPad mini with @1x display running iOS ≥ 7
* `114×114px` iPhone with @2x display running iOS ≤ 6
* `120×120px` iPhone with @2x and @3x display running iOS ≥ 7
* `144×144px` iPad and iPad mini with @2x display running iOS ≤ 6
* `152×152px` iPad and iPad mini with @2x display running iOS 7
* `180×180px` iPad and iPad mini with @2x display running iOS 8
Displays meaning:
* @1x - non-Retina
* @2x - Retina
* @3x - Retina HD
More information about the displays of iOS devices can be found
[here](https://en.wikipedia.org/wiki/List_of_iOS_devices#Display).
In most cases, one `180×180px` touch icon named `apple-touch-icon.png`
and including:
```html
<link rel="apple-touch-icon" href="apple-touch-icon.png">
```
in the `<head>` of the page is enough. If you use art-direction and/or
want to have different content for each device, you can add more touch
icons as written above.
For a more comprehensive overview, please refer to Mathias' [article on Touch
Icons](https://mathiasbynens.be/notes/touch-icons).
### Apple Touch Startup Image
Apart from that it is possible to add start-up screens for web apps on iOS. This
basically works by defining `apple-touch-startup-image` with an according link
to the image. Since iOS devices have different screen resolutions it is
necessary to add media queries to detect which image to load. Here is an
example for a retina iPhone:
```html
<link rel="apple-touch-startup-image" media="(max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2)" href="img/startup-retina.png">
```
However, it is possible to detect which start-up image to use with JavaScript.
The Mobile Boilerplate provides a useful function for this. Please see
[helpers.js](https://github.com/h5bp/mobile-boilerplate/blob/v4.1.0/js/helper.js#L336-L383)
for the implementation.
### Chrome Mobile web apps
Chrome Mobile has a specific meta tag for making apps [installable to the
homescreen](https://developer.chrome.com/multidevice/android/installtohomescreen)
which tries to be a more generic replacement to Apple's proprietary meta tag:
```html
<meta name="mobile-web-app-capable" content="yes">
```
Same applies to the touch icons:
```html
<link rel="icon" sizes="192x192" href="highres-icon.png">
```
### Theme Color
You can add the [`theme-color` meta extension](https://github.com/whatwg/meta-theme-color)
in the `<head>` of your pages to suggest the color that browsers and
OSes should use if they customize the display of individual pages in
their UIs with varying colors.
```html
<meta name="theme-color" content="#ff69b4">
```
The `content` attribute extension can take any valid CSS color.
Currently, the `theme-color` meta extension is supported by [Chrome 39+
for Android Lollipop](http://updates.html5rocks.com/2014/11/Support-for-theme-color-in-Chrome-39-for-Android)
and [Firefox OS 2.1+](https://twitter.com/ahmednefzaoui/status/492344698493997057).

62
dist/doc/faq.md vendored Normal file
View File

@@ -0,0 +1,62 @@
[HTML5 Boilerplate homepage](https://html5boilerplate.com) | [Documentation
table of contents](TOC.md)
# Frequently asked questions
* [Why don't you automatically load the latest version of jQuery from the Google
CDN?](#why-dont-you-automatically-load-the-latest-version-of-jquery-from-the-google-cdn)
* [Why is the Google Analytics code at the bottom? Google recommends it be
placed in the `<head>`.](#why-is-the-google-analytics-code-at-the-bottom-google-recommends-it-be-placed-in-the-head)
* [How can I integrate Bootstrap with HTML5
Boilerplate?](#how-can-i-integrate-bootstrap-with-html5-boilerplate)
* [Do I need to upgrade my site each time a new version of HTML5 Boilerplate is
released?](#do-i-need-to-upgrade-my-site-each-time-a-new-version-of-html5-boilerplate-is-released)
* [Where can I get help with support
questions?](#where-can-i-get-help-with-support-questions)
--
### Why don't you automatically load the latest version of jQuery from the Google CDN?
The [file](https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js) to which
the Google [CDN](https://en.wikipedia.org/wiki/Content_delivery_network) points
to is [no longer updated and will stay locked at version `1.11.1` in order to
prevent inadvertent web
breakage](http://blog.jquery.com/2014/07/03/dont-use-jquery-latest-js/).
In general, version updating should be an intentional decision! You shouldn't
include a URL that will always point to the latest version, as that version:
* may not be compatible with the existing plugins/code on the site
* will have a very short cache time compare to the specific version,
which means that users won't get the benefits of long-term caching
### Why is the Google Analytics code at the bottom? Google recommends it be placed in the `<head>`.
The main advantage of placing it in the `<head>` is that you will track the
user's `pageview` even if they leave the page before it has been fully loaded.
However, having the code at the bottom of the page [helps improve
performance](https://stevesouders.com/efws/inline-scripts-bottom.php).
### How can I integrate [Bootstrap](http://getbootstrap.com/) with HTML5 Boilerplate?
One simple way is to use [Initializr](http://www.initializr.com/) and create a
custom build that includes both HTML5 Boilerplate and
[Bootstrap](http://getbootstrap.com/).
Read more about how [HTML5 Boilerplate and Bootstrap complement each
other](https://www.quora.com/Is-Bootstrap-a-complement-or-an-alternative-to-HTML5-Boilerplate-or-viceversa/answer/Nicolas-Gallagher).
### Do I need to upgrade my site each time a new version of HTML5 Boilerplate is released?
No, same as you don't normally replace the foundation of a house once it
was built. However, there is nothing stopping you from trying to work in the
latest changes, but you'll have to assess the costs/benefits of doing so.
### Where can I get help with support questions?
Please ask for help on
[StackOverflow](https://stackoverflow.com/questions/tagged/html5boilerplate).

223
dist/doc/html.md vendored Normal file
View File

@@ -0,0 +1,223 @@
[HTML5 Boilerplate homepage](https://html5boilerplate.com) | [Documentation
table of contents](TOC.md)
# The HTML
By default, HTML5 Boilerplate provides two `html` pages:
* [`index.html`](#indexhtml) - a default HTML skeleton that should form the
basis of all pages on your website
* [`404.html`](#404html) - a placeholder 404 error page
## `index.html`
### The `no-js` class
The `no-js` class is provided in order to allow you to more easily and
explicitly add custom styles based on whether JavaScript is disabled
(`.no-js`) or enabled (`.js`). Using this technique also helps [avoid the
FOUC](https://www.paulirish.com/2009/avoiding-the-fouc-v3/).
## Language attribute
Please consider specifying the language of your content by adding the `lang`
attribute to `<html>` as in this example:
```html
<html class="no-js" lang="en">
```
### The order of the `<title>` and `<meta>` tags
The order in which the `<title>` and the `<meta>` tags are specified is
important because:
1) the charset declaration (`<meta charset="utf-8">`):
* must be included completely within the [first 1024 bytes of the
document](https://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#charset)
* should be specified as early as possible (before any content that could
be controlled by an attacker, such as a `<title>` element) in order to
avoid a potential [encoding-related security
issue](https://code.google.com/p/doctype-mirror/wiki/ArticleUtf7) in
Internet Explorer
2) the meta tag for compatibility mode
(`<meta http-equiv="x-ua-compatible" content="ie=edge">`):
* [needs to be included before all other tags except for the `<title>` and
the other `<meta>`
tags](https://msdn.microsoft.com/en-us/library/cc288325.aspx)
### `x-ua-compatible`
Internet Explorer 8/9/10 support [document compatibility
modes](https://msdn.microsoft.com/en-us/library/cc288325.aspx) that affect the
way webpages are interpreted and displayed. Because of this, even if your site's
visitor is using, let's say, Internet Explorer 9, it's possible that IE will not
use the latest rendering engine, and instead, decide to render your page using
the Internet Explorer 5.5 rendering engine.
Specifying the `x-ua-compatible` meta tag:
```html
<meta http-equiv="x-ua-compatible" content="ie=edge">
```
or sending the page with the following HTTP response header
```
X-UA-Compatible: IE=edge
```
will force Internet Explorer 8/9/10 to render the webpage in the highest
available mode in [the various cases when it may
not](https://hsivonen.fi/doctype/#ie8), and therefore, ensure that anyone
browsing your site is treated to the best possible user experience that
browser can offer.
If possible, we recommend that you remove the `meta` tag and send only the
HTTP response header as the `meta` tag will not always work if your site is
served on a non-standard port, as Internet Explorer's preference option
`Display intranet sites in Compatibility View` is checked by default.
If you are using Apache as your webserver, including the
[`.htaccess`](https://github.com/h5bp/server-configs-apache) file takes care of
the HTTP header. If you are using a different server, check out our [other
server config](https://github.com/h5bp/server-configs).
Starting with Internet Explorer 11, [document modes are
deprecated](https://msdn.microsoft.com/en-us/library/ie/bg182625.aspx#docmode).
If your business still relies on older web apps and services that were
designed for older versions of Internet Explorer, you might want to consider
enabling [Enterprise Mode](http://blogs.msdn.com/b/ie/archive/2014/04/02/stay-up-to-date-with-enterprise-mode-for-internet-explorer-11.aspx) throughout your company.
## Mobile viewport
There are a few different options that you can use with the [`viewport` meta
tag](https://docs.google.com/present/view?id=dkx3qtm_22dxsrgcf4 "Viewport and
Media Queries - The Complete Idiot's Guide"). You can find out more in [the
Apple developer docs](https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariWebContent/UsingtheViewport/UsingtheViewport.html).
HTML5 Boilerplate comes with a simple setup that strikes a good balance for general use cases.
```html
<meta name="viewport" content="width=device-width, initial-scale=1">
```
## Favicons and Touch Icon
The shortcut icons should be put in the root directory of your site. HTML5
Boilerplate comes with a default set of icons (include favicon and one Apple
Touch Icon) that you can use as a baseline to create your own.
Please refer to the more detailed description in the [Extend section](extend.md)
of these docs.
## Modernizr
HTML5 Boilerplate uses a custom build of Modernizr.
[Modernizr](http://modernizr.com) is a JavaScript library which adds classes to
the `html` element based on the results of feature test and which ensures that
all browsers can make use of HTML5 elements (as it includes the HTML5 Shiv).
This allows you to target parts of your CSS and JavaScript based on the
features supported by a browser.
In general, in order to keep page load times to a minimum, it's best to call
any JavaScript at the end of the page because if a script is slow to load
from an external server it may cause the whole page to hang. That said, the
Modernizr script *needs* to run *before* the browser begins rendering the page,
so that browsers lacking support for some of the new HTML5 elements are able to
handle them properly. Therefore the Modernizr script is the only JavaScript
file synchronously loaded at the top of the document.
## What about polyfills?
If you need to include [polyfills](https://remysharp.com/2010/10/08/what-is-a-polyfill)
in your project, you must make sure those load before any other JavaScript. If you're
using some polyfill CDN service, like [cdn.polyfill.io](https://cdn.polyfill.io/),
just put it before the other scripts in the bottom of the page:
```html
<script src="https://cdn.polyfill.io/v1/polyfill.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.11.2.min.js"><\/script>')</script>
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>
</body>
```
If you like to just include the polyfills yourself, you could include them in
`js/plugins.js`. When you have a bunch of polyfills to load in, you could
also create a `polyfills.js` file in the `js/vendor` directory. Also using
this technique, make sure the polyfills are all loaded before any other
Javascript.
There are some misconceptions about Modernizr and polyfills. It's important
to understand that Modernizr just handles feature checking, not polyfilling
itself. The only thing Modernizr does regarding polyfills is that the team
maintains [a huge list of cross Browser polyfills](https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyfills).
## The content area
The central part of the boilerplate template is pretty much empty. This is
intentional, in order to make the boilerplate suitable for both web page and
web app development.
### Browser Upgrade Prompt
The main content area of the boilerplate includes a prompt to install an up to
date browser for users of IE 6/7. If you intended to support IE 6/7, then you
should remove the snippet of code.
### Google CDN for jQuery
The Google CDN version of the jQuery JavaScript library is referenced towards
the bottom of the page using a protocol-independent path (read more about this
in the [FAQ](faq.md)). A local fallback of jQuery is included for rare instances
when the CDN version might not be available, and to facilitate offline
development.
The Google CDN version is chosen over other [potential candidates (like the
jQuery CDN](https://jquery.com/download/#using-jquery-with-a-cdn)) because
it's fast in absolute terms and it has the best overall
[penetration](http://httparchive.org/trends.php#perGlibs) which increases the
odds of having a copy of the library in your user's browser cache.
While the Google CDN is a strong default solution your site or application may
require a different configuration. Testing your site with services like
[WebPageTest](https://www.webpagetest.org/) and browser tools like
[PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights/) or
[YSlow](https://developer.yahoo.com/yslow/) will help you examine the real
world performance of your site and can show where you can optimize your specific
site or application.
### Google Universal Analytics Tracking Code
Finally, an optimized version of the Google Universal Analytics tracking code is
included. Google recommends that this script be placed at the top of the page.
Factors to consider: if you place this script at the top of the page, youll
be able to count users who dont fully load the page, and youll incur the max
number of simultaneous connections of the browser.
Further information:
* [Optimizing the Google Universal Analytics
Snippet](https://mathiasbynens.be/notes/async-analytics-snippet#universal-analytics)
* [Introduction to
Analytics.js](https://developers.google.com/analytics/devguides/collection/analyticsjs/)
* [Google Analytics Demos & Tools](https://ga-dev-tools.appspot.com/)
**N.B.** The Google Universal Analytics snippet is included by default mainly
because Google Analytics is [currently one of the most popular tracking
solutions](https://trends.builtwith.com/analytics/Google-Analytics) out there.
However, its usage isn't set in stone, and you SHOULD consider exploring the
[alternatives](https://en.wikipedia.org/wiki/List_of_web_analytics_software)
and use whatever suits your needs best!

37
dist/doc/js.md vendored Normal file
View File

@@ -0,0 +1,37 @@
[HTML5 Boilerplate homepage](https://html5boilerplate.com) | [Documentation
table of contents](TOC.md)
# The JavaScript
Information about the default JavaScript included in the project.
## main.js
This file can be used to contain or reference your site/app JavaScript code.
For larger projects, you can make use of a JavaScript module loader, like
[Require.js](http://requirejs.org/), to load any other scripts you need to
run.
## plugins.js
This file can be used to contain all your plugins, such as jQuery plugins and
other 3rd party scripts.
One approach is to put jQuery plugins inside of a `(function($){ ...
})(jQuery);` closure to make sure they're in the jQuery namespace safety
blanket. Read more about [jQuery plugin
authoring](https://learn.jquery.com/plugins/#Getting_Started).
By default the `plugins.js` file contains a small script to avoid `console`
errors in browsers that lack a `console`. The script will make sure that, if
a console method isn't available, that method will have the value of empty
function, thus, preventing the browser from throwing an error.
## vendor
This directory can be used to contain all 3rd party library code.
Minified versions of the latest jQuery and Modernizr libraries are included by
default. You may wish to create your own [custom Modernizr
build](http://www.modernizr.com/download/).

175
dist/doc/misc.md vendored Normal file
View File

@@ -0,0 +1,175 @@
[HTML5 Boilerplate homepage](https://html5boilerplate.com) | [Documentation
table of contents](TOC.md)
# Miscellaneous
* [.gitignore](#gitignore)
* [.editorconfig](#editorconfig)
* [Server Configuration](#server-configuration)
* [crossdomain.xml](#crossdomainxml)
* [robots.txt](#robotstxt)
* [browserconfig.xml](#browserconfigxml)
--
## .gitignore
HTML5 Boilerplate includes a basic project-level `.gitignore`. This should
primarily be used to avoid certain project-level files and directories from
being kept under source control. Different development-environments will
benefit from different collections of ignores.
OS-specific and editor-specific files should be ignored using a "global
ignore" that applies to all repositories on your system.
For example, add the following to your `~/.gitconfig`, where the `.gitignore`
in your HOME directory contains the files and directories you'd like to
globally ignore:
```gitignore
[core]
excludesfile = ~/.gitignore
```
* More on global ignores: https://help.github.com/articles/ignoring-files
* Comprehensive set of ignores on GitHub: https://github.com/github/gitignore
## .editorconfig
The `.editorconfig` file is provided in order to encourage and help you and
your team define and maintain consistent coding styles between different
editors and IDEs.
By default, `.editorconfig` includes some basic
[properties](http://editorconfig.org/#supported-properties) that reflect the
coding styles from the files provided by default, but you can easily change
them to better suit your needs.
In order for your editor/IDE to apply the
[properties](http://editorconfig.org/#supported-properties) from the
`.editorconfig` file, you will need to [install a
plugin]( http://editorconfig.org/#download).
__N.B.__ If you aren't using the server configurations provided by HTML5
Boilerplate, we highly encourage you to configure your server to block
access to `.editorconfig` files, as they can disclose sensitive information!
For more details, please refer to the [EditorConfig
project](http://editorconfig.org/).
## Server Configuration
H5BP includes a [`.htaccess`](#htaccess) file for the Apache HTTP server. If you are not using
Apache as your web server, then you are encouraged to download a
[server configuration](https://github.com/h5bp/server-configs) that corresponds
to your web server and environment.
A `.htaccess` (hypertext access) file is a
[Apache HTTP server configuration file](https://github.com/h5bp/server-configs-apache).
The `.htaccess` file is mostly used for:
* Rewriting URLs
* Controlling cache
* Authentication
* Server-side includes
* Redirects
* Gzipping
If you have access to the main server configuration file (usually called
`httpd.conf`), you should add the logic from the `.htaccess` file in, for
example, a <Directory> section in the main configuration file. This is usually
the recommended way, as using .htaccess files slows down Apache!
To enable Apache modules locally, please see:
https://github.com/h5bp/server-configs-apache/wiki/How-to-enable-Apache-modules.
In the repo the `.htaccess` is used for:
* Allowing cross-origin access to web fonts
* CORS header for images when browsers request it
* Enable `404.html` as 404 error document
* Making the website experience better for IE users better
* Media UTF-8 as character encoding for `text/html` and `text/plain`
* Enabling the rewrite URLs engine
* Forcing or removing the `www.` at the begin of a URL
* It blocks access to directories without a default document
* It blocks access to files that can expose sensitive information.
* It reduces MIME type security risks
* It forces compressing (gzipping)
* It tells the browser whether they should request a specific file from the
server or whether they should grab it from the browser's cache
When using `.htaccess` we recommend reading all inline comments (the rules after
a `#`) in the file once. There is a bunch of optional stuff in it.
If you want to know more about the `.htaccess` file check out
https://httpd.apache.org/docs/current/howto/htaccess.html.
Notice that the original repo for the `.htaccess` file is [this
one](https://github.com/h5bp/server-configs-apache).
## crossdomain.xml
The _cross-domain policy file_ is an XML document that gives a web client —
such as Adobe Flash Player, Adobe Reader, etc. — permission to handle data
across multiple domains, by:
* granting read access to data
* permitting the client to include custom headers in cross-domain requests
* granting permissions for socket-based connections
__e.g.__ If a client hosts content from a particular source domain and that
content makes requests directed towards a domain other than its own, the remote
domain would need to host a cross-domain policy file in order to grant access
to the source domain and allow the client to continue with the transaction.
For more in-depth information, please see Adobe's [cross-domain policy file
specification](https://www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html).
## robots.txt
The `robots.txt` file is used to give instructions to web robots on what can
be crawled from the website.
By default, the file provided by this project includes the next two lines:
* `User-agent: *` - the following rules apply to all web robots
* `Disallow:` - everything on the website is allowed to be crawled
If you want to disallow certain pages you will need to specify the path in a
`Disallow` directive (e.g.: `Disallow: /path`) or, if you want to disallow
crawling of all content, use `Disallow: /`.
The `/robots.txt` file is not intended for access control, so don't try to
use it as such. Think of it as a "No Entry" sign, rather than a locked door.
URLs disallowed by the `robots.txt` file might still be indexed without being
crawled, and the content from within the `robots.txt` file can be viewed by
anyone, potentially disclosing the location of your private content! So, if
you want to block access to private content, use proper authentication instead.
For more information about `robots.txt`, please see:
* [robotstxt.org](http://www.robotstxt.org/)
* [How Google handles the `robots.txt` file](https://developers.google.com/webmasters/control-crawl-index/docs/robots_txt)
## browserconfig.xml
The `browserconfig.xml` file is used to customize the tile displayed when users
pin your site to the Windows 8.1 start screen. In there you can define custom
tile colors, custom images or even [live tiles](https://msdn.microsoft.com/en-us/library/ie/dn455106.aspx#CreatingLiveTiles).
By default, the file points to 2 placeholder tile images:
* `tile.png` (558x558px): used for `Small`, `Medium` and `Large` tiles.
This image resizes automatically when necessary.
* `tile-wide.png` (558x270px): user for `Wide` tiles.
Notice that IE11 uses the same images when adding a site to the `favorites`.
For more in-depth information about the `browserconfig.xml` file, please
see [MSDN](https://msdn.microsoft.com/en-us/library/ie/dn320426.aspx).

130
dist/doc/usage.md vendored Normal file
View File

@@ -0,0 +1,130 @@
[HTML5 Boilerplate homepage](https://html5boilerplate.com) | [Documentation
table of contents](TOC.md)
# Usage
Once you have cloned or downloaded HTML5 Boilerplate, creating a site or app
usually involves the following:
1. Set up the basic structure of the site.
2. Add some content, style, and functionality.
3. Run your site locally to see how it looks.
4. (Optionally run a build script to automate the optimization of your site -
e.g. [ant build script](https://github.com/h5bp/ant-build-script))
5. Deploy your site.
## Basic structure
A basic HTML5 Boilerplate site initially looks something like this:
```
.
├── css
│ ├── main.css
│ └── normalize.css
├── doc
├── img
├── js
│ ├── main.js
│ ├── plugins.js
│ └── vendor
│ ├── jquery.min.js
│ └── modernizr.min.js
├── .editorconfig
├── .htaccess
├── 404.html
├── apple-touch-icon.png
├── browserconfig.xml
├── index.html
├── humans.txt
├── robots.txt
├── crossdomain.xml
├── favicon.ico
├── tile-wide.png
└── tile.png
```
What follows is a general overview of each major part and how to use them.
### css
This directory should contain all your project's CSS files. It includes some
initial CSS to help get you started from a solid foundation. [About the
CSS](css.md).
### doc
This directory contains all the HTML5 Boilerplate documentation. You can use it
as the location and basis for your own project's documentation.
### js
This directory should contain all your project's JS files. Libraries, plugins,
and custom code can all be included here. It includes some initial JS to help
get you started. [About the JavaScript](js.md).
### .htaccess
The default web server configs are for Apache. For more information, please
refer to the [Apache Server Configs
repository](https://github.com/h5bp/server-configs-apache).
Host your site on a server other than Apache? You're likely to find the
corresponding server configs project listed in our [Server Configs
](https://github.com/h5bp/server-configs/blob/master/README.md) repository.
### 404.html
A helpful custom 404 to get you started.
### browserconfig.xml
This file contains all settings regarding custom tiles for IE11.
For more info on this topic, please refer to
[MSDN](https://msdn.microsoft.com/en-us/library/ie/dn455106.aspx).
### .editorconfig
The `.editorconfig` file is provided in order to encourage and help you and
your team to maintain consistent coding styles between different
editors and IDEs. [Read more about the `.editorconfig` file](misc.md#editorconfig).
### index.html
This is the default HTML skeleton that should form the basis of all pages on
your site. If you are using a server-side templating framework, then you will
need to integrate this starting HTML with your setup.
Make sure that you update the URLs for the referenced CSS and JavaScript if you
modify the directory structure at all.
If you are using Google Universal Analytics, make sure that you edit the
corresponding snippet at the bottom to include your analytics ID.
### humans.txt
Edit this file to include the team that worked on your site/app, and the
technology powering it.
### robots.txt
Edit this file to include any pages you need hidden from search engines.
### crossdomain.xml
A template for working with cross-domain requests. [About
crossdomain.xml](misc.md#crossdomainxml).
### Icons
Replace the default `favicon.ico`, `tile.png`, `tile-wide.png` and Apple
Touch Icon with your own.
If you want to use different Apple Touch Icons for different resolutions please
refer to the [according documentation](extend.md#apple-touch-icons).
You might want to check out Hans' handy [HTML5 Boilerplate Favicon and Apple
Touch Icon
PSD-Template](https://drublic.de/blog/html5-boilerplate-favicons-psd-template/).

BIN
dist/favicon.ico vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

15
dist/humans.txt vendored Normal file
View File

@@ -0,0 +1,15 @@
# humanstxt.org/
# The humans responsible & technology colophon
# TEAM
<name> -- <role> -- <twitter>
# THANKS
<name>
# TECHNOLOGY COLOPHON
CSS3, HTML5
Apache Server Configs, jQuery, Modernizr, Normalize.css

0
dist/img/.gitignore vendored Normal file
View File

40
dist/index.html vendored Normal file
View File

@@ -0,0 +1,40 @@
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="apple-touch-icon" href="apple-touch-icon.png">
<!-- Place favicon.ico in the root directory -->
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/main.css">
<script src="js/vendor/modernizr-2.8.3.min.js"></script>
</head>
<body>
<!--[if lt IE 8]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<!-- Add your site or application content here -->
<p>Hello world! This is HTML5 Boilerplate.</p>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.11.3.min.js"><\/script>')</script>
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>
<!-- Google Analytics: change UA-XXXXX-X to be your site's ID. -->
<script>
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
e=o.createElement(i);r=o.getElementsByTagName(i)[0];
e.src='https://www.google-analytics.com/analytics.js';
r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
ga('create','UA-XXXXX-X','auto');ga('send','pageview');
</script>
</body>
</html>

0
dist/js/main.js vendored Normal file
View File

24
dist/js/plugins.js vendored Normal file
View File

@@ -0,0 +1,24 @@
// Avoid `console` errors in browsers that lack a console.
(function() {
var method;
var noop = function () {};
var methods = [
'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
'timeline', 'timelineEnd', 'timeStamp', 'trace', 'warn'
];
var length = methods.length;
var console = (window.console = window.console || {});
while (length--) {
method = methods[length];
// Only stub undefined methods.
if (!console[method]) {
console[method] = noop;
}
}
}());
// Place any jQuery/helper plugins in here.

6
dist/js/vendor/jquery-1.11.3.min.js vendored Normal file

File diff suppressed because one or more lines are too long

4
dist/js/vendor/modernizr-2.8.3.min.js vendored Normal file

File diff suppressed because one or more lines are too long

5
dist/robots.txt vendored Normal file
View File

@@ -0,0 +1,5 @@
# www.robotstxt.org/
# Allow crawling of all content
User-agent: *
Disallow:

BIN
dist/tile-wide.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
dist/tile.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

170
gulpfile.js Normal file
View File

@@ -0,0 +1,170 @@
var fs = require('fs');
var path = require('path');
var gulp = require('gulp');
// Load all gulp plugins automatically
// and attach them to the `plugins` object
var plugins = require('gulp-load-plugins')();
// Temporary solution until gulp 4
// https://github.com/gulpjs/gulp/issues/355
var runSequence = require('run-sequence');
var pkg = require('./package.json');
var dirs = pkg['h5bp-configs'].directories;
// ---------------------------------------------------------------------
// | Helper tasks |
// ---------------------------------------------------------------------
gulp.task('archive:create_archive_dir', function () {
fs.mkdirSync(path.resolve(dirs.archive), '0755');
});
gulp.task('archive:zip', function (done) {
var archiveName = path.resolve(dirs.archive, pkg.name + '_v' + pkg.version + '.zip');
var archiver = require('archiver')('zip');
var files = require('glob').sync('**/*.*', {
'cwd': dirs.dist,
'dot': true // include hidden files
});
var output = fs.createWriteStream(archiveName);
archiver.on('error', function (error) {
done();
throw error;
});
output.on('close', done);
files.forEach(function (file) {
var filePath = path.resolve(dirs.dist, file);
// `archiver.bulk` does not maintain the file
// permissions, so we need to add files individually
archiver.append(fs.createReadStream(filePath), {
'name': file,
'mode': fs.statSync(filePath)
});
});
archiver.pipe(output);
archiver.finalize();
});
gulp.task('clean', function (done) {
require('del')([
dirs.archive,
dirs.dist
], done);
});
gulp.task('copy', [
'copy:.htaccess',
'copy:index.html',
'copy:jquery',
'copy:license',
'copy:main.css',
'copy:misc',
'copy:normalize'
]);
gulp.task('copy:.htaccess', function () {
return gulp.src('node_modules/apache-server-configs/dist/.htaccess')
.pipe(plugins.replace(/# ErrorDocument/g, 'ErrorDocument'))
.pipe(gulp.dest(dirs.dist));
});
gulp.task('copy:index.html', function () {
return gulp.src(dirs.src + '/index.html')
.pipe(plugins.replace(/{{JQUERY_VERSION}}/g, pkg.devDependencies.jquery))
.pipe(gulp.dest(dirs.dist));
});
gulp.task('copy:jquery', function () {
return gulp.src(['node_modules/jquery/dist/jquery.min.js'])
.pipe(plugins.rename('jquery-' + pkg.devDependencies.jquery + '.min.js'))
.pipe(gulp.dest(dirs.dist + '/js/vendor'));
});
gulp.task('copy:license', function () {
return gulp.src('LICENSE.txt')
.pipe(gulp.dest(dirs.dist));
});
gulp.task('copy:main.css', function () {
var banner = '/*! HTML5 Boilerplate v' + pkg.version +
' | ' + pkg.license.type + ' License' +
' | ' + pkg.homepage + ' */\n\n';
return gulp.src(dirs.src + '/css/main.css')
.pipe(plugins.header(banner))
.pipe(plugins.autoprefixer({
browsers: ['last 2 versions', 'ie >= 8', '> 1%'],
cascade: false
}))
.pipe(gulp.dest(dirs.dist + '/css'));
});
gulp.task('copy:misc', function () {
return gulp.src([
// Copy all files
dirs.src + '/**/*',
// Exclude the following files
// (other tasks will handle the copying of these files)
'!' + dirs.src + '/css/main.css',
'!' + dirs.src + '/index.html'
], {
// Include hidden files by default
dot: true
}).pipe(gulp.dest(dirs.dist));
});
gulp.task('copy:normalize', function () {
return gulp.src('node_modules/normalize.css/normalize.css')
.pipe(gulp.dest(dirs.dist + '/css'));
});
gulp.task('lint:js', function () {
return gulp.src([
'gulpfile.js',
dirs.src + '/js/*.js',
dirs.test + '/*.js'
]).pipe(plugins.jscs())
.pipe(plugins.jshint())
.pipe(plugins.jshint.reporter('jshint-stylish'))
.pipe(plugins.jshint.reporter('fail'));
});
// ---------------------------------------------------------------------
// | Main tasks |
// ---------------------------------------------------------------------
gulp.task('archive', function (done) {
runSequence(
'build',
'archive:create_archive_dir',
'archive:zip',
done);
});
gulp.task('build', function (done) {
runSequence(
['clean', 'lint:js'],
'copy',
done);
});
gulp.task('default', ['build']);

View File

@@ -1,43 +0,0 @@
/* the humans responsible & colophon */
/* humanstxt.org */
/* TEAM */
<your title>: <your name>
Site:
Twitter:
Location:
/* THANKS */
Names (& URL):
/* SITE */
Standards: HTML5, CSS3
Components: Modernizr, jQuery
Software:
-o/-
+oo//-
:ooo+//:
-ooooo///-
/oooooo//:
:ooooooo+//-
-+oooooooo///-
-://////////////+oooooooooo++////////////::
:+ooooooooooooooooooooooooooooooooooooo+:::-
-/+ooooooooooooooooooooooooooooooo+/::////:-
-:+oooooooooooooooooooooooooooo/::///////:-
--/+ooooooooooooooooooooo+::://////:-
-:+ooooooooooooooooo+:://////:--
/ooooooooooooooooo+//////:-
-ooooooooooooooooooo////-
/ooooooooo+oooooooooo//:
:ooooooo+/::/+oooooooo+//-
-oooooo/::///////+oooooo///-
/ooo+::://////:---:/+oooo//:
-o+/::///////:- -:/+o+//-
:-:///////:- -:/://
-////:- --//:
-- -:

2
img/.gitignore vendored
View File

@@ -1,2 +0,0 @@
!.gitignore

View File

@@ -1,80 +0,0 @@
<!doctype html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7 ]> <html class="no-js ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]> <html class="no-js ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]> <html class="no-js ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame
Remove this if you use the .htaccess -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="author" content="">
<!-- Mobile viewport optimized: j.mp/bplateviewport -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Place favicon.ico & apple-touch-icon.png in the root of your domain and delete these references -->
<link rel="shortcut icon" href="/favicon.ico">
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
<!-- CSS: implied media="all" -->
<link rel="stylesheet" href="css/style.css?v=2">
<!-- Uncomment if you are specifically targeting less enabled mobile browsers
<link rel="stylesheet" media="handheld" href="css/handheld.css?v=2"> -->
<!-- All JavaScript at the bottom, except for Modernizr which enables HTML5 elements & feature detects -->
<script src="js/libs/modernizr-1.7.min.js"></script>
</head>
<body>
<div id="container">
<header>
</header>
<div id="main" role="main">
</div>
<footer>
</footer>
</div> <!--! end of #container -->
<!-- JavaScript at the bottom for fast page loading -->
<!-- Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if necessary -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.js"></script>
<script>window.jQuery || document.write('<script src="js/libs/jquery-1.5.1.min.js">\x3C/script>')</script>
<!-- scripts concatenated and minified via ant build script-->
<script src="js/plugins.js"></script>
<script src="js/script.js"></script>
<!-- end scripts-->
<!--[if lt IE 7 ]>
<script src="js/libs/dd_belatedpng.js"></script>
<script>DD_belatedPNG.fix('img, .png_bg'); // Fix any <img> or .png_bg bg-images. Also, please read goo.gl/mZiyb </script>
<![endif]-->
<!-- mathiasbynens.be/notes/async-analytics-snippet Change UA-XXXXX-X to be your site's ID -->
<script>
var _gaq=[['_setAccount','UA-XXXXX-X'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=1;
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>

File diff suppressed because one or more lines are too long

8316
js/libs/jquery-1.5.1.js vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,2 +0,0 @@
!.gitignore

Some files were not shown because too many files have changed in this diff Show More