layout-content-narrow.pcss.css
Same filename in other branches
Grid system definition for the content narrow layout.
File
-
core/
themes/ olivero/ css/ layout/ layout-content-narrow.pcss.css
View source
- /**
- * @file
- * Grid system definition for the content narrow layout.
- */
-
- @import "../base/variables.pcss.css";
-
- .layout--content-narrow,
- .layout--pass--content-narrow > * {
- grid-column: 1 / 7;
- width: 100%;
-
- @media (--grid-md) {
- grid-column: 2 / 14;
- }
-
- @media (--lg) {
- grid-column: 3 / 11;
- }
- }
-
- /*
- If .layout--content-narrow is nested within any of the following, allocate the appropriate
- amount of columns within its parent .grid-full.
- - .layout--content-narrow class.
- - Element that's inheriting the layout--content-narrow styles from its parent region.
- - .layout--content-medium class.
- - Element that's inheriting the layout--content-medium styles from its parent region.
- */
- .layout--content-narrow,
- .layout--pass--content-narrow > *,
- .layout--content-medium,
- .layout--pass--content-medium > * {
- & .layout--content-narrow,
- & .layout--pass--content-narrow > * {
- @media (--grid-md) {
- grid-column: 1 / 13;
- }
-
- @media (--lg) {
- grid-column: 1 / 9;
- }
- }
- }
-
- /*
- Special grid-breaking treatment for text-content elements that
- reside in a content-narrow layout.
- */
- .layout--content-narrow,
- .layout--pass--content-narrow > * {
- &.text-content,
- & .text-content {
- & blockquote {
- &:before {
- @media (--grid-md) {
- inset-inline-start: calc(-1 * (var(--grid-col-width--md) + var(--grid-gap--md)));
- }
-
- @media (--lg) {
- inset-inline-start: calc(-1 * (var(--grid-col-width--lg) + var(--grid-gap--lg)));
- }
-
- @media (--nav) {
- inset-inline-start: calc(-1 * (var(--grid-col-width--nav) + var(--grid-gap--nav)));
- }
-
- @media (--grid-max) {
- inset-inline-start: calc(-1 * (var(--grid-col-width--max) + var(--grid-gap--max)));
- }
- }
-
- &:after {
- @media (--grid-md) {
- inset-inline-start: calc(-1 * (var(--grid-col-width--md) + var(--grid-gap--md)));
- width: var(--sp);
- height: calc(100% - 45px);
- margin-inline-start: 2px;
- }
-
- @media (--lg) {
- inset-inline-start: calc(-1 * (var(--grid-col-width--lg) + var(--grid-gap--lg)));
- }
-
- @media (--nav) {
- inset-inline-start: calc(-1 * (var(--grid-col-width--nav) + var(--grid-gap--nav)));
- }
-
- @media (--grid-max) {
- inset-inline-start: calc(-1 * (var(--grid-col-width--max) + var(--grid-gap--max)));
- }
- }
-
- @media (--grid-md) {
- width: calc(10 * var(--grid-col-width--md) + 9 * var(--grid-gap--md));
- margin-block: var(--sp3);
- padding-inline-start: 0;
- }
-
- @media (--lg) {
- width: calc(10 * var(--grid-col-width--lg) + 9 * var(--grid-gap--lg));
- }
-
- @media (--nav) {
- width: calc(10 * var(--grid-col-width--nav) + 9 * var(--grid-gap--nav));
- }
-
- @media (--grid-max) {
- width: calc(10 * var(--grid-col-width--max) + 9 * var(--grid-gap--max));
- }
- }
-
- & pre {
- @media (--grid-md) {
- margin-block: var(--sp3);
- }
-
- @media (--lg) {
- width: calc(12 * var(--grid-col-width--lg) + 11 * var(--grid-gap--lg));
- margin-inline-start: calc(-1 * (var(--grid-col-width--lg) + var(--grid-gap--lg)));
- }
-
- @media (--nav) {
- width: calc(12 * var(--grid-col-width--nav) + 11 * var(--grid-gap--nav));
- margin-inline-start: calc(-1 * (var(--grid-col-width--nav) + var(--grid-gap--nav)));
- }
-
- @media (--grid-max) {
- width: calc(12 * var(--grid-col-width--max) + 11 * var(--grid-gap--max));
- margin-inline-start: calc(-1 * (var(--grid-col-width--max) + var(--grid-gap--max)));
- }
- }
- }
- }
-
- /**
- *
and elements should not break containers and overflow
- * into sidebar region when present.
- */
- .sidebar-grid {
- & .layout--content-narrow,
- & .layout--pass--content-narrow > * {
- &.text-content,
- & .text-content {
- & blockquote,
- & pre {
- width: auto;
- }
- }
- }
- }
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.