From 76f5b51ce419c0aba01931daad2860cd70be32ca Mon Sep 17 00:00:00 2001 From: jimmyfrasche Date: Sun, 22 Apr 2018 16:06:11 -0700 Subject: [PATCH] x/tools/godoc: make front page video respond to layout changes (2/2) This part of a multi-repo change. See CL 108677 for details. Note: this change also requires a CL to golang/go to complete the fix, though either CL without the other is harmless. Updates golang/go#24997. Change-Id: I99ca9a4e6df16347b8706f24cef9689b3345854a Reviewed-on: https://go-review.googlesource.com/108678 Run-TryBot: Andrew Bonventre TryBot-Result: Gobot Gobot Reviewed-by: Andrew Bonventre --- godoc/static/static.go | 16 ++++++++++++++++ godoc/static/style.css | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/godoc/static/static.go b/godoc/static/static.go index 45478e3c22..22351f2f0d 100644 --- a/godoc/static/static.go +++ b/godoc/static/static.go @@ -3479,6 +3479,22 @@ div#blog .read { text-align: right; } +@supports (--c: 0) { + [style*="--aspect-ratio-padding:"] { + position: relative; + overflow: hidden; + padding-top: var(--aspect-ratio-padding); + } + + [style*="--aspect-ratio-padding:"]>* { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + } +} + .toggleButton { cursor: pointer; } .toggle > .collapsed { display: block; } .toggle > .expanded { display: none; } diff --git a/godoc/static/style.css b/godoc/static/style.css index cf2f47ae69..3d1b1a0125 100644 --- a/godoc/static/style.css +++ b/godoc/static/style.css @@ -476,6 +476,22 @@ div#blog .read { text-align: right; } +@supports (--c: 0) { + [style*="--aspect-ratio-padding:"] { + position: relative; + overflow: hidden; + padding-top: var(--aspect-ratio-padding); + } + + [style*="--aspect-ratio-padding:"]>* { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + } +} + .toggleButton { cursor: pointer; } .toggle > .collapsed { display: block; } .toggle > .expanded { display: none; }