Customizing embed aspect ratios
See original GitHub issueThe way to customize the embed aspect ratios is some confusing.
(1) The following SCSS occurs compile ERROR:
$embed-responsive-aspect-ratios: (2 1);
@import "../node_modules/bootstrap/scss/bootstrap";
Error message:
List index is 2 but list is only 1 item long for `nth'
Demo: https://www.sassmeister.com/gist/d8f4ece6f886602fc110c594a33357f5
(2) The following SCSS is OK:
$embed-responsive-aspect-ratios: (2 1), ;
@import "../node_modules/bootstrap/scss/bootstrap";
(3) The following SCSS is OK:
$embed-responsive-aspect-ratios: (2 1), (3 1);
@import "../node_modules/bootstrap/scss/bootstrap";
SASS seems to recognize $list: (2 1)
as a list included the two values instead of one set of two values.
Demo: https://codepen.io/anon/pen/GzgrwL?editors=1111 - See console view
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
How to modify your embed code to support custom video sizes
To make sure your video maintains a 16:9 aspect ratio, just divide your custom width (960 pixels) by 1.7777, which would equal 540....
Read more >New aspect-ratio CSS property supported in Chromium, Safari ...
Maintaining aspect ratio within images and elements is now easier to achieve with the new aspect-ratio CSS property.
Read more >Foundation CSS Responsive Embed Aspect Ratios
responsive-embed class. The Aspect Ratios class allows you to change the aspect ratio of the responsive embed. The default ratio is 4:3. The...
Read more >Video html embed with dynamic aspect ratios - Custom code
I'm loading several vimeo hosted videos through a collection to a html embed. And the videos all have different aspect ratios.
Read more >Bootstrap Ratio / Embeds - examples & tutorial
Use the ratio helper to manage the aspect ratios of external content like <iframe> s, <embed> s, <video> s, and <object> s. These...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Wow. That is some clunky syntax but thanks for pointing me in the right direction, @MartijnCuppens.
Hi @martinbean, this is related to your comment on #25894. It’s not easy to define a sass list with one item. The most straightforward method is
$embed-responsive-aspect-ratios: append((), (4 3))
I guess. We’ll probably change this inv5
and will use sass maps like ysds describes above.But I think we’ll also need to add a notice about this in our docs for
v4
since it seems a lot of people are having troubles with this.