Skip to content

Commit d896bdd

Browse files
authored
Nest the callout code-edge rules under their shared prefixes
Each block now reads as code at the first or last edge of a callout body, with the long shared selector prefix written once. The compiled CSS is byte-identical to the flat form.
1 parent 791123a commit d896bdd

1 file changed

Lines changed: 29 additions & 18 deletions

File tree

‎src/resources/formats/html/bootstrap/_bootstrap-rules.scss‎

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,30 +1531,41 @@ kbd,
15311531
// copy button. At a callout edge, space the scaffold with margin instead of
15321532
// padding and drop the code block's own margin, so the button stays inside
15331533
// the code frame and the gap matches a paragraph's.
1534-
.callout .callout-body-container > .code-copy-outer-scaffold:first-child > div.sourceCode,
1535-
.callout .callout-body-container > .cell:first-child > .code-copy-outer-scaffold:first-child > div.sourceCode {
1536-
margin-top: 0;
1537-
}
1534+
.callout .callout-body-container {
1535+
> .code-copy-outer-scaffold:first-child,
1536+
> .cell:first-child > .code-copy-outer-scaffold:first-child {
1537+
> div.sourceCode {
1538+
margin-top: 0;
1539+
}
1540+
}
15381541

1539-
.callout .callout-body-container > .code-copy-outer-scaffold:last-child > div.sourceCode,
1540-
.callout .callout-body-container > .cell:last-child > .code-copy-outer-scaffold:last-child > div.sourceCode {
1541-
margin-bottom: 0;
1542+
> .code-copy-outer-scaffold:last-child,
1543+
> .cell:last-child > .code-copy-outer-scaffold:last-child {
1544+
> div.sourceCode {
1545+
margin-bottom: 0;
1546+
}
1547+
}
15421548
}
15431549

1544-
.callout.callout-style-default .callout-body > .code-copy-outer-scaffold:first-child,
1545-
.callout.callout-style-default .callout-body > .cell:first-child:has(> .code-copy-outer-scaffold:first-child) {
1546-
padding-top: 0;
1547-
margin-top: 0.5rem;
1550+
.callout.callout-style-default .callout-body {
1551+
> .code-copy-outer-scaffold:first-child,
1552+
> .cell:first-child:has(> .code-copy-outer-scaffold:first-child) {
1553+
padding-top: 0;
1554+
margin-top: 0.5rem;
1555+
}
15481556
}
15491557

1550-
.callout.callout-titled .callout-body > .code-copy-outer-scaffold:last-child,
1551-
.callout.callout-titled .callout-body > .cell:last-child:has(> .code-copy-outer-scaffold:last-child) {
1552-
padding-bottom: 0;
1553-
margin-bottom: 0.5rem;
1554-
}
1558+
.callout.callout-titled .callout-body {
1559+
> .code-copy-outer-scaffold:last-child,
1560+
> .cell:last-child:has(> .code-copy-outer-scaffold:last-child) {
1561+
padding-bottom: 0;
1562+
margin-bottom: 0.5rem;
1563+
}
15551564

1556-
.callout.callout-titled .callout-body > .cell:last-child > .code-copy-outer-scaffold:last-child {
1557-
padding-bottom: 0;
1565+
// Undoes the `> div > :last-child` padding above for code ending a cell.
1566+
> .cell:last-child > .code-copy-outer-scaffold:last-child {
1567+
padding-bottom: 0;
1568+
}
15581569
}
15591570

15601571
.callout:not(.callout-titled) .callout-body > :first-child,

0 commit comments

Comments
 (0)