1
0
mirror of https://github.com/locomotivemtl/locomotive-boilerplate.git synced 2026-01-15 00:55:08 +08:00

4 Commits

Author SHA1 Message Date
Lucas Bigot
e8701712b6 Horizontally align iframe 2024-03-28 11:17:17 -04:00
Lucas Bigot
92ba51bef1 Reset custom list markers 2024-03-28 11:00:07 -04:00
Lucas Bigot
ebbb20d0e3 Set iframe full width if no width & height specific html attributes 2024-03-28 10:51:31 -04:00
Lucas Bigot
fae0c2a6dc Set generic spacing rule + Move link color settings into wysiwyg file 2024-03-28 10:32:53 -04:00
3 changed files with 67 additions and 164 deletions

View File

@@ -3,9 +3,14 @@
// ==========================================================================
.c-wysiwyg {
// ==========================================================================
// Margins
// ==========================================================================
& > * + * {
margin-bottom: size-clamp('md');
}
&-first-element,
>:first-child {
margin-top: 0 !important;
@@ -24,134 +29,25 @@
// @include text;
// @include body-large;
// ==========================================================================
// Paragraph
// ==========================================================================
p,
iframe,
img,
table {
margin-bottom: rem(30px);
& + p,
& + ul,
& + ol {
margin-top: 1em;
margin-bottom: rem(30px);
}
& + h1,
& + h2,
& + h3,
& + h4,
& + h5,
& + h6 {
margin-top: rem(60px);
}
}
// ==========================================================================
// Headings
// ==========================================================================
b, strong {
}
h1,h2,h3,h4,h5,h6 {
// @include heading;
font-weight: normal;
margin-top: 1.5em;
margin-bottom: 1em;
}
h1 {
// @include heading-h3;
margin-top: size-clamp('lg');
margin-bottom: rem(40px);
& + p,
& + ul,
& + ol,
& + table,
& + figure {
margin-top: rem(40px);
}
& + h1,
& + h2,
& + h3,
& + h4,
& + h5,
& + h6 {
margin-top: size-clamp('md');
}
}
h2 {
// @include heading-h3;
margin-top: size-clamp('lg');
margin-bottom: size-clamp('md');
& + p,
& + ul,
& + ol,
& + table,
& + figure {
margin-top: size-clamp('md');
}
& + h1,
& + h2,
& + h3,
& + h4,
& + h5,
& + h6 {
margin-top: size-clamp('md');
}
}
h3 {
// @include heading-h4;
margin-top: size-clamp('lg');
margin-bottom: size-clamp('md');
& + p,
& + ul,
& + ol,
& + table,
& + figure {
margin-top: size-clamp('md');
}
& + h1,
& + h2,
& + h3,
& + h4,
& + h5,
& + h6 {
margin-top: size-clamp('md');
}
}
h4,
h5,
h6 {
margin-top: size-clamp('lg');
margin-bottom: size-clamp('sm');
& + p,
& + ul,
& + ol,
& + table,
& + figure {
margin-top: size-clamp('sm');
}
& + h1,
& + h2,
& + h3,
& + h4,
& + h5,
& + h6 {
margin-top: size-clamp('sm');
}
}
h4 {
@@ -171,11 +67,41 @@
// ==========================================================================
ul,
ol {
& + p,
& + ul,
& + ol,
& + blockquote {
margin-top: size-clamp('sm');
list-style: none;
padding-left: 0;
> li {
position: relative;
padding-left: 1.5em;
}
}
ul {
> li {
&::before {
content: "";
position: absolute;
left: 0;
top: calc(50% - 3px);
width: 6px;
height: 6px;
background-color: currentColor;
border-radius: 50%;
}
}
}
ol {
counter-reset: counter;
> li {
counter-increment: counter;
&::before {
content: counter(counter);
position: absolute;
left: 0;
}
}
}
@@ -183,12 +109,16 @@
// Link
// ==========================================================================
a {
text-decoration: underline;
text-decoration-thickness: 1px;
word-wrap: break-word;
color: $color-link;
&:hover {
text-decoration-thickness: 2px;
&:focus-visible {
color: $color-link-focus;
}
@media (hover: hover) {
&:hover {
color: $color-link-hover;
}
}
}
@@ -197,16 +127,23 @@
// ==========================================================================
img {
width: 100%;
margin: size-clamp('lg') 0;
}
// ==========================================================================
// iFrame
// ==========================================================================
iframe {
width: 100%;
height: auto;
margin: size-clamp('lg') 0;
display: block;
margin-left: auto;
margin-right: auto;
&:not([width]) {
width: 100%;
}
&:not([height]) {
height: auto;
}
}
// ==========================================================================
@@ -214,27 +151,12 @@
// ==========================================================================
table {
width: 100%;
margin: size-clamp('lg') 0;
& + p,
& + ul,
& + ol {
margin-top: 1em;
}
& + h1,
& + h2,
& + h3,
& + h4,
& + h5,
& + h6 {
margin-top: 1em;
}
}
caption {
padding: 10px;
font-style: italic;
// @include text;
// @include body-small;
margin: 1em 0;
}
// ==========================================================================
@@ -245,7 +167,6 @@
// @include heading-h3;
quotes: "" "" "" "";
padding: 0;
margin: size-clamp('md') 0;
p {
&::before {
@@ -260,15 +181,5 @@
& + p {
padding-top: 0;
}
& + h1,
& + h2,
& + h3,
& + h4,
& + h5,
& + h6,
& + blockquote {
margin-top: 0;
}
}
}

View File

@@ -53,11 +53,3 @@ body {
color: $color-selection-text;
text-shadow: none;
}
a {
color: $color-link;
@include u-hocus {
color: $color-link-hover;
}
}

View File

@@ -49,8 +49,8 @@ $color-link-focus: color(primary);
$color-link-hover: darken(color(primary), 10%);
// Selection
$color-selection-text: color(darkest);
$color-selection-background: color(lightest);
$color-selection-text: color(lightest);
$color-selection-background: color(darkest);
// Socials
$color-facebook: #3B5998;