Skip to content

Commit

Permalink
Put the names that the validator uses for the boilerplate into the sp…
Browse files Browse the repository at this point in the history
…ec (ampproject#3273)

* Put the names that the validator uses for the boilerplate into the
link and headline for the AMP Boilerplate. This should help people
if they're looking for it with CTRL+F or search engines.

* add clarifying comment

* tweaks

* use dom selectors style

* amp-boilerplate
  • Loading branch information
powdercloud committed May 26, 2016
1 parent adaf23c commit ad762bd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion spec/amp-boilerplate.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,15 @@ See the License for the specific language governing permissions and
limitations under the License.
-->

# AMP Boilerplate Code
# AMP Boilerplate Code ('head > style[amp-boilerplate]' and 'noscript > style[amp-boilerplate]')

AMP HTML documents must contain the following boilerplate in their `head` tag.
Validation is currently done with regular expressions, so it's important to keep
mutations as minimal as possible. Currently, allowed mutations are: (1)
inserting arbitrary whitespace immediately after the `style` tag opens, and
immediately before it closes; (2) replacing any space in the snippet below with
arbitrary whitespace.

```
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
```
2 changes: 1 addition & 1 deletion spec/amp-html-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ AMP HTML documents MUST
- <a name="chrs"></a>contain a `<meta charset="utf-8">` tag as the first child of their head tag. [🔗](#chrs)
- <a name="vprt"></a>contain a `<meta name="viewport" content="width=device-width,minimum-scale=1">` tag inside their head tag. It's also recommend to include `initial-scale=1` (1). [🔗](#vprt)
- <a name="scrpt"></a>contain a `<script async src="https://cdn.ampproject.org/v0.js"></script>` tag inside their head tag. [🔗](#scrpt)
- <a name="boilerplate"></a>contain the [AMP boilerplate code](amp-boilerplate.md) in their head tag. [🔗](#boilerplate)
- <a name="boilerplate"></a>contain the [AMP boilerplate code ('head > style[amp-boilerplate]' and 'noscript > style[amp-boilerplate]')](amp-boilerplate.md) in their head tag. [🔗](#boilerplate)

(1) `width=device-width,minimum-scale=1` is required to ensure [GPU rasterization](https://www.chromium.org/developers/design-documents/chromium-graphics/how-to-get-gpu-rasterization) is enabled.

Expand Down

0 comments on commit ad762bd

Please sign in to comment.