Skip to content

Instantly share code, notes, and snippets.

@fabienheureux
Last active April 29, 2026 14:51
Show Gist options
  • Select an option

  • Save fabienheureux/d7d972cb6342e4e83842c4179149c2a0 to your computer and use it in GitHub Desktop.

Select an option

Save fabienheureux/d7d972cb6342e4e83842c4179149c2a0 to your computer and use it in GitHub Desktop.
<style>
/* 1) Lift the 40rem prose cap on the editorial chain that contains our iframe. */
.page-node-type-contenu-classement .contenu-classement-content
> .field--name-field-contenu-editorial:has(iframe[src*="infog-index.rsf.org"]),
.page-node-type-contenu-classement .contenu-classement-content
> .field--name-field-contenu-editorial > .field__item:has(.paragraph--type--texte-riche > .field--name-field-texte-riche > iframe[src*="infog-index.rsf.org"]) {
max-width: none !important;
width: 100% !important;
}
/* 2) Restore the 40rem cap on every sibling paragraph (those without our iframe). */
.page-node-type-contenu-classement .contenu-classement-content
> .field--name-field-contenu-editorial:has(iframe[src*="infog-index.rsf.org"])
> .field__item
> .paragraph:not(:has(iframe[src*="infog-index.rsf.org"])) {
max-width: 40rem;
margin-left: auto;
margin-right: auto;
}
/* 3) Bleed the iframe paragraph past the container's L/R padding (responsive). */
.page-node-type-contenu-classement .contenu-classement-content
.paragraph--type--texte-riche:has(> .field--name-field-texte-riche > iframe[src*="infog-index.rsf.org"]) {
max-width: none !important;
width: calc(100% + 3rem) !important;
margin-left: -1.5rem !important;
margin-right: -1.5rem !important;
margin-top: 2rem !important;
margin-bottom: 2rem !important;
}
@media (min-width: 992px) {
.page-node-type-contenu-classement .contenu-classement-content
.paragraph--type--texte-riche:has(> .field--name-field-texte-riche > iframe[src*="infog-index.rsf.org"]) {
width: calc(100% + 12rem) !important;
margin-left: -6rem !important;
margin-right: -6rem !important;
margin-top: 3rem !important;
margin-bottom: 3rem !important;
}
}
/* 4) Stretch the inner rich-text wrapper and the iframe itself. */
.page-node-type-contenu-classement .contenu-classement-content
.paragraph--type--texte-riche:has(> .field--name-field-texte-riche > iframe[src*="infog-index.rsf.org"])
> .field--name-field-texte-riche {
max-width: none !important;
width: 100% !important;
}
.page-node-type-contenu-classement .contenu-classement-content
.paragraph--type--texte-riche:has(> .field--name-field-texte-riche > iframe[src*="infog-index.rsf.org"])
> .field--name-field-texte-riche > iframe[src*="infog-index.rsf.org"] {
display: block;
width: 100%;
max-width: 100%;
border: 0;
min-height: 80vh;
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment