Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored callouts using maps, loops, placeholders, and mixins #314

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
144 changes: 71 additions & 73 deletions SCSS/Theme Rewrite/custom-css/callouts/_callout-adjustments.scss
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
@use "utils";

// No Title
.callout.callout.callout.callout:is(
[data-callout-metadata~="no-t"],
[data-callout-metadata~="no-title"]
) > .callout-title { display: none; }

// Show Title
.callout.callout.callout.callout:is(
[data-callout-metadata~="s-t"],
[data-callout-metadata~="show-title"]
) {
& > .callout-title { display: flex; }

& > .callout-content > p { margin-top: 0; }
}
// Subtitle
.callout.callout.callout.callout:is(
[data-callout-metadata~="subtitle"],
[data-callout-metadata~="subt"]
) {
@include utils.select-by-callout-metadata(4, "no-t", "no-title") {
& > .callout-title {
display: none;
}
}

@include utils.select-by-callout-metadata(4, "s-t", "show-title") {
& > .callout-title {
display: flex;
}

& > .callout-content > p {
margin-top: 0;
}
}

@include utils.select-by-callout-metadata(4, "subtitle", "subt") {
& .callout-title {
align-content: center;
align-items: center;

& em {
display: block;
font-style: normal;
Expand All @@ -38,84 +36,80 @@
}
}



// No Icon
.callout.callout:is(
[data-callout-metadata~="no-i"],
[data-callout-metadata~="no-icon"]
) > .callout-title > .callout-icon {
width: 0; height: 0;
--icon-size: 0;
@include utils.select-by-callout-metadata(2, "no-i", "no-icon") {
& > .callout-title > .callout-icon {
width: 0;
height: 0;
--icon-size: 0;
}
} // For Export

//No Table Header

@include utils.select-by-callout-metadata(1, "n-th", "no-table-header") {
& .callout-content table {
margin-bottom: 5px;

//No Table Header
.callout:is(
[data-callout-metadata~="n-th"],
[data-callout-metadata~="no-table-header"]
) > .callout-content {
& table {
margin-bottom: 5px;

& thead,
& th { display: none; }
& th {
display: none;
}
}
}

//Wide Table
.callout:is(
[data-callout-metadata~="t-w"],
[data-callout-metadata~="table-wide"]
) {
& table {
width: 100%;

& td { width: calc(var(--tbl-w) / 2); }
@include utils.select-by-callout-metadata(1, "t-w", "table-wide") {
& table {
width: 100%;

& td {
width: calc(var(--tbl-w) / 2);
}
}
}
//Table Text Alignment
.callout[data-callout-metadata~="table-cell-top"] table td
{ vertical-align: top; }
//Table Margins
.callout.callout:is(
[data-callout-metadata~=t-nmg],
[data-callout-metadata~=table-no-margin]
) table {
margin-block-start: 0;
margin-block-end: 0;
}
//Table Text Alignment

@include utils.select-by-callout-metadata(1, "table-cell-top") {
& table td {
vertical-align: top;
}
}
//Table Margins

@include utils.select-by-callout-metadata(2, "t-nmg", "table-no-margin") {
& table {
margin-block-start: 0;
margin-block-end: 0;
}
}

//Expand for Embed
.callout[data-callout-metadata~="embed"] {

@include utils.select-by-callout-metadata(1, "embed") {
& .callout-content,
& > .callout-content > p {
margin: 0;
padding: 0;
}
}




//Collapse
.callout[data-callout-metadata~="collapse"] * {
margin: 0 !important;
padding: 0 !important;
grid-gap: 0 !important;
@include utils.select-by-callout-metadata(1, "collapse") {
& * {
margin: 0 !important;
padding: 0 !important;
grid-gap: 0 !important;
}
}

//Borderless
.callout.callout.callout:is(
[data-callout-metadata~="nbrd"],
[data-callout-metadata~="no-border"]
) { border: 0; }
@include utils.select-by-callout-metadata(3, "nbrd", "no-border") {
border: 0;
}

//Clean
.callout.callout.callout[data-callout-metadata~="clean"],
.callout.callout.callout[data-callout-metadata~="clean"] > .callout-content {
@include utils.select-by-callout-metadata(3, "clean") {
border: 0;
box-shadow: none;
--callout-color: transparent;
Expand All @@ -127,7 +121,11 @@
}

//Clear
.callout[data-callout-metadata~="clear"] { clear: both; }
@include utils.select-by-callout-metadata(1, "clear") {
clear: both;
}

//Fix iframe Code
.callout #vid { text-align: left; }
.callout #vid {
text-align: left;
}
Loading