{"id":19739479,"url":"https://github.com/suitcss/components-flex-embed","last_synced_at":"2025-12-12T04:33:34.417Z","repository":{"id":5045017,"uuid":"6205535","full_name":"suitcss/components-flex-embed","owner":"suitcss","description":"Component CSS for intrinsic ratio embeds","archived":false,"fork":false,"pushed_at":"2016-10-13T02:11:43.000Z","size":57,"stargazers_count":111,"open_issues_count":1,"forks_count":15,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-07-12T00:57:29.660Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://suitcss.github.io/components-flex-embed/test/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"spotify/annoy","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/suitcss.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-10-13T17:36:24.000Z","updated_at":"2024-07-31T17:31:48.000Z","dependencies_parsed_at":"2022-08-30T20:00:54.466Z","dependency_job_id":null,"html_url":"https://github.com/suitcss/components-flex-embed","commit_stats":null,"previous_names":["suitcss/flex-embed"],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/suitcss/components-flex-embed","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suitcss%2Fcomponents-flex-embed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suitcss%2Fcomponents-flex-embed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suitcss%2Fcomponents-flex-embed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suitcss%2Fcomponents-flex-embed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/suitcss","download_url":"https://codeload.github.com/suitcss/components-flex-embed/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suitcss%2Fcomponents-flex-embed/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265704202,"owners_count":23814186,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T01:17:27.349Z","updated_at":"2025-10-30T04:42:39.347Z","avatar_url":"https://github.com/suitcss.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SUIT CSS components-flex-embed\n\n[![Build Status](https://travis-ci.org/suitcss/components-flex-embed.svg?branch=master)](https://travis-ci.org/suitcss/components-flex-embed)\n\nCSS for responsive, intrinsic ratio embeds. Includes modifier classes for 3:1,\n2:1, 16:9, and 4:3 aspect ratios.\n\nRead more about [SUIT CSS's design principles](https://github.com/suitcss/suit/).\n\n## Installation\n\n* [npm](https://www.npmjs.org/package/suitcss-components-flex-embed): `npm install suitcss-components-flex-embed`\n* Download: [zip](https://github.com/suitcss/components-flex-embed/releases/latest)\n\n## Available classes\n\n* `FlexEmbed` - The root node.\n* `FlexEmbed-ratio` - The element that provides the aspect ratio (1:1 by default).\n* `FlexEmbed-ratio--3by1` - The modifier class for 3:1 aspect ratio embed.\n* `FlexEmbed-ratio--2by1` - The modifier class for 2:1 aspect ratio embed,\n* `FlexEmbed-ratio--16by9` - The modifier class for 16:9 aspect ratio embed.\n* `FlexEmbed-ratio--4by3` - The modifier class for 4:3 aspect ratio embed.\n* `FlexEmbed-content` - The descendent class for the content that is being displayed.\n\n## Usage\n\nExample:\n\n```html\n\u003cdiv class=\"FlexEmbed\"\u003e\n  \u003cdiv class=\"FlexEmbed-ratio FlexEmbed-ratio--16by9\"\u003e\u003c/div\u003e\n  \u003cdiv class=\"FlexEmbed-content\"\u003e\n    \u003c!-- child content --\u003e\n  \u003c/div\u003e\n\u003c/div\u003e\n```\n\nYou can add custom own aspect ratios. For example, to create a 2.35:1 aspect\nratio:\n\n```css\n/**\n * Modifier: 47:20 aspect ratio\n */\n\n.FlexEmbed-ratio--47by20 {\n  padding-bottom: 42.55%;\n}\n```\n\nAlternatively, aspect ratios can be calculated programmatically and the\ncorresponding `padding-bottom` value applied using an inline style.\n\n```html\n\u003cdiv class=\"FlexEmbed\"\u003e\n  \u003cdiv class=\"FlexEmbed-ratio\" style=\"padding-bottom:{{percentage}}%\"\u003e\u003c/div\u003e\n  \u003cdiv class=\"FlexEmbed-content\"\u003e\n    \u003c!-- child content --\u003e\n  \u003c/div\u003e\n\u003c/div\u003e\n```\n\n## Testing\n\nInstall [Node](http://nodejs.org) (comes with npm).\n\n```\nnpm install\n```\n\nTo generate a build:\n\n```\nnpm run build\n```\n\nTo lint code with [postcss-bem-linter](https://github.com/postcss/postcss-bem-linter) and [stylelint](http://stylelint.io/)\n\n```\nnpm run lint\n```\n\nTo generate the testing build.\n\n```\nnpm run build-test\n```\n\nTo watch the files for making changes to test:\n\n```\nnpm run watch\n```\n\nBasic visual tests are in `test/index.html`.\n\n## Browser support\n\n* Google Chrome (latest)\n* Opera (latest)\n* Firefox 4+\n* Safari 5+\n* Internet Explorer 9+\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuitcss%2Fcomponents-flex-embed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuitcss%2Fcomponents-flex-embed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuitcss%2Fcomponents-flex-embed/lists"}