Skip to content

Commit

Permalink
Add implicit layout comments (#28190)
Browse files Browse the repository at this point in the history
  • Loading branch information
jridgewell authored May 6, 2020
1 parent 6b2a4bc commit e35e2fa
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion css/ampshared.css
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@
/* Display is set/reset via the hidden attribute */
}

/**
* layout=fixed does not have a unresolved implicit style, due to conflicts
* with non-amp elements.
* https://github.com/ampproject/amphtml/pull/28115#discussion_r419843723
*/
.i-amphtml-layout-fixed,
[layout=fixed][width][height]:not(.i-amphtml-layout-fixed)
{
Expand Down Expand Up @@ -87,13 +92,23 @@
display: block !important;
}

/**
* layout=fixed-height does not have a unresolved implicit style, due to
* conflicts with non-amp elements.
* https://github.com/ampproject/amphtml/pull/28115#discussion_r419843723
*/
.i-amphtml-layout-fixed-height,
[layout=fixed-height][height]:not(.i-amphtml-layout-fixed-height)
{
display: block;
position: relative;
}

/**
* layout=container does not have a unresolved implicit style, due to conflicts
* with non-amp elements.
* https://github.com/ampproject/amphtml/pull/28115#discussion_r419843723
*/
.i-amphtml-layout-container,
[layout=container]
{
Expand Down Expand Up @@ -230,6 +245,10 @@ i-amphtml-sizer {
/* For author styling. */
}

/**
* [width][height][sizes] and [width][height][heights] imply layout=responsive
* before the element has resolved.
*/
.i-amphtml-notbuilt,
[layout]:not(.i-amphtml-element),
[width][height][sizes]:not([layout]):not(.i-amphtml-element),
Expand All @@ -240,7 +259,11 @@ i-amphtml-sizer {
color: transparent !important;
}

/* Hide all children of non-container elements. */
/**
* Hide all children of non-container elements.
* [width][height][sizes] and [width][height][heights] imply layout=responsive
* before the element has resolved.
*/
.i-amphtml-notbuilt:not(.i-amphtml-layout-container) > * ,
[layout]:not([layout=container]):not(.i-amphtml-element) > *,
[width][height][sizes]:not([layout]):not(.i-amphtml-element) > *,
Expand All @@ -261,6 +284,10 @@ i-amphtml-sizer {
/* Just state. */
}

/**
* [width][height][sizes] and [width][height][heights] imply layout=responsive
* before the element has resolved.
*/
.i-amphtml-element > [placeholder],
[layout]:not(.i-amphtml-element) > [placeholder],
[width][height][sizes]:not([layout]):not(.i-amphtml-element) > [placeholder],
Expand Down

0 comments on commit e35e2fa

Please sign in to comment.