Skip to content

Latest commit

 

History

History
56 lines (43 loc) · 1.76 KB

amp-dynamic-css-classes.md

File metadata and controls

56 lines (43 loc) · 1.76 KB

AMP Dynamic CSS Classes

Description Adds several dynamic CSS class names onto the HTML element.
Availability Experimental
Examples None

Behavior

The AMP Dynamic CSS Classes extension adds the following CSS classes onto the HTML element:

amp-referrer-*

One or more referrer classes will be set, one for each level of subdomain specificity. For example, www.google.com will add three classes: amp-referrer-www-google-com, amp-referrer-google-com, and amp-referrer-com.

We currently have a few special cases:

  • When the user came through a Twitter t.co short link, we instead use twitter.com as the referrer.
  • When the string "Pinterest" is present in the User Agent string and there is no referrer, we use www.pinterest.com as the referrer.

amp-viewer

The amp-viewer class will be set if the current document is being displayed inside a Viewer.