bep40 commited on
Commit
413f2b5
·
verified ·
1 Parent(s): 63fecd9

Make 1:1 (ratio-square) override win regardless of CSS load order by raising specificity with #tiktok-feed ancestor

Browse files
Files changed (1) hide show
  1. static/fm_fix.css +16 -5
static/fm_fix.css CHANGED
@@ -70,12 +70,13 @@
70
  A YouTube <iframe> ignores object-fit, so instead of letterboxing we size the
71
  iframe to FULL slide height and 16:9 width (177.78vh -> wider than a phone),
72
  center it, and let the slide's overflow:hidden clip the sides.
73
- These rules load after app_v2.js's injected <style> and use !important,
74
- so they override the old (broken) object-fit:contain square version.
 
75
  ============================================================ */
76
- .tiktok-slide.ratio-square{position:relative!important;overflow:hidden!important;display:block!important;background:#000!important}
77
- .tiktok-slide.ratio-square>iframe,
78
- .tiktok-slide.ratio-square>video{
79
  position:absolute!important;
80
  top:50%!important;
81
  left:50%!important;
@@ -87,3 +88,13 @@
87
  max-height:none!important;
88
  object-fit:cover!important; /* affects <video>; harmless for <iframe> */
89
  }
 
 
 
 
 
 
 
 
 
 
 
70
  A YouTube <iframe> ignores object-fit, so instead of letterboxing we size the
71
  iframe to FULL slide height and 16:9 width (177.78vh -> wider than a phone),
72
  center it, and let the slide's overflow:hidden clip the sides.
73
+ The #tiktok-feed ancestor raises specificity above app_v2.js's injected
74
+ `.tiktok-slide.ratio-square>iframe` rule, so this wins regardless of CSS
75
+ load order (not just !important + source order).
76
  ============================================================ */
77
+ #tiktok-feed .tiktok-slide.ratio-square{position:relative!important;overflow:hidden!important;display:block!important;background:#000!important}
78
+ #tiktok-feed .tiktok-slide.ratio-square>iframe,
79
+ #tiktok-feed .tiktok-slide.ratio-square>video{
80
  position:absolute!important;
81
  top:50%!important;
82
  left:50%!important;
 
88
  max-height:none!important;
89
  object-fit:cover!important; /* affects <video>; harmless for <iframe> */
90
  }
91
+ /* Fallback copy at plain specificity too (in case the feed id ever differs) */
92
+ .tiktok-slide.ratio-square{position:relative!important;overflow:hidden!important;display:block!important;background:#000!important}
93
+ .tiktok-slide.ratio-square>iframe,
94
+ .tiktok-slide.ratio-square>video{
95
+ position:absolute!important;top:50%!important;left:50%!important;
96
+ transform:translate(-50%,-50%)!important;
97
+ height:100%!important;width:177.78vh!important;
98
+ min-width:100%!important;max-width:none!important;max-height:none!important;
99
+ object-fit:cover!important;
100
+ }