Skip to content

Commit

Permalink
🖍 Cleanup several unresolved amp-layout CSS states (#28115)
Browse files Browse the repository at this point in the history
* Cleanup several unresolved amp-layout CSS states

- Adds unresolved layout for `intrinsic` styles
- Fixes specificity for unresolved `fixed-height` styles
- Adds unresolved implicit layout `responsive` styles

* Fix fixed-height selector

* Add in implicit responsive with heights
  • Loading branch information
jridgewell authored May 5, 2020
1 parent 9e71d9f commit 5d859d4
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions css/ampshared.css
Original file line number Diff line number Diff line change
Expand Up @@ -63,26 +63,32 @@

.i-amphtml-layout-responsive,
[layout=responsive][width][height]:not(.i-amphtml-layout-responsive),
[width][height][sizes]:not([layout]):not(.i-amphtml-layout-responsive)
[width][height][sizes]:not([layout]):not(.i-amphtml-layout-responsive),
[width][height][heights]:not([layout]):not(.i-amphtml-layout-responsive)
{
display: block;
position: relative;
}

.i-amphtml-layout-intrinsic
.i-amphtml-layout-intrinsic,
[layout=intrinsic][width][height]:not(.i-amphtml-layout-intrinsic)
{
display: inline-block;
position: relative;
max-width: 100%;
}

.i-amphtml-layout-intrinsic .i-amphtml-sizer {
max-width: 100%;
}

.i-amphtml-intrinsic-sizer {
max-width: 100%;
display: block !important;
}

.i-amphtml-layout-fixed-height,
[layout=fixed-height][height]
[layout=fixed-height][height]:not(.i-amphtml-layout-fixed-height)
{
display: block;
position: relative;
Expand Down Expand Up @@ -156,10 +162,6 @@ i-amphtml-sizer {
right: 0;
}

.i-amphtml-layout-intrinsic .i-amphtml-sizer {
max-width: 100%;
}

.i-amphtml-replaced-content {
padding: 0 !important;
border: none !important;
Expand Down Expand Up @@ -229,7 +231,9 @@ i-amphtml-sizer {
}

.i-amphtml-notbuilt,
[layout]:not(.i-amphtml-element)
[layout]:not(.i-amphtml-element),
[width][height][sizes]:not([layout]):not(.i-amphtml-element),
[width][height][heights]:not([layout]):not(.i-amphtml-element)
{
position: relative;
overflow: hidden !important;
Expand All @@ -238,7 +242,9 @@ i-amphtml-sizer {

/* Hide all children of non-container elements. */
.i-amphtml-notbuilt:not(.i-amphtml-layout-container) > * ,
[layout]:not([layout=container]):not(.i-amphtml-element) > *
[layout]:not([layout=container]):not(.i-amphtml-element) > *,
[width][height][sizes]:not([layout]):not(.i-amphtml-element) > *,
[width][height][heights]:not([layout]):not(.i-amphtml-element) > *
{
display: none;
}
Expand All @@ -256,7 +262,10 @@ i-amphtml-sizer {
}

.i-amphtml-element > [placeholder],
[layout]:not(.i-amphtml-element) > [placeholder] {
[layout]:not(.i-amphtml-element) > [placeholder],
[width][height][sizes]:not([layout]):not(.i-amphtml-element) > [placeholder],
[width][height][heights]:not([layout]):not(.i-amphtml-element) > [placeholder]
{
display: block;
}

Expand Down

0 comments on commit 5d859d4

Please sign in to comment.