]> BookStack Code Mirror - bookstack/blobdiff - resources/sass/_text.scss
ZIP Imports: Added API examples, finished testing
[bookstack] / resources / sass / _text.scss
index f2c88d96dd1ffdc87761fa0ec7f45c45c779b450..04fd31e6df7ee91a52fbba460a0d1bc007bd307c 100644 (file)
@@ -1,3 +1,6 @@
+@use "mixins";
+@use "vars";
+
 /**
  * Fonts
  */
@@ -42,13 +45,8 @@ h1, h2, h3, h4, h5, h6 {
   font-weight: 400;
   position: relative;
   display: block;
-  font-family: var(--font-heading);
-  @include lightDark(color, #222, #BBB);
-  .subheader {
-    font-size: 0.5em;
-    line-height: 1em;
-    color: lighten($text-dark, 32%);
-  }
+  font-family: var(--font-heading, var(--font-body));
+  @include mixins.lightDark(color, #222, #BBB);
 }
 
 h5 {
@@ -61,7 +59,7 @@ h5, h6 {
   margin-bottom: 0.66em;
 }
 
-@include smaller-than($s) {
+@include mixins.smaller-than(vars.$bp-s) {
   h1 {
     font-size: 2.8275em;
   }
@@ -138,16 +136,16 @@ p, ul, ol, pre, table, blockquote {
 hr {
   border: 0;
   height: 1px;
-  @include lightDark(background, #eaeaea, #555);
-  margin-bottom: $-l;
+  @include mixins.lightDark(background, #eaeaea, #555);
+  margin-bottom: vars.$l;
   &.faded {
     background-image: linear-gradient(to right, #FFF, #e3e0e0 20%, #e3e0e0 80%, #FFF);
   }
   &.darker {
-    @include lightDark(background, #DDD, #666);
+    @include mixins.lightDark(background, #DDD, #666);
   }
   &.margin-top, &.even {
-    margin-top: $-l;
+    margin-top: vars.$l;
   }
 }
 
@@ -179,10 +177,10 @@ sub, .subscript {
 pre {
   font-size: 12px;
   border: 1px solid #DDD;
-  @include lightDark(background-color, #FFF, #2B2B2B);
-  @include lightDark(border-color, #DDD, #111);
+  @include mixins.lightDark(background-color, #FFF, #2B2B2B);
+  @include mixins.lightDark(border-color, #DDD, #111);
   border-radius: 4px;
-  padding-left: 26px;
+  padding-inline-start: 26px;
   position: relative;
   padding-top: 3px;
   padding-bottom: 3px;
@@ -192,10 +190,10 @@ pre {
     position: absolute;
     top: 0;
     width: 22.4px;
-    left: 0;
+    inset-inline-start: 0;
     height: 100%;
-    @include lightDark(background-color, #f5f5f5, #313335);
-    @include lightDark(border-right, 1px solid #DDD, none);
+    @include mixins.lightDark(background-color, #f5f5f5, #313335);
+    @include mixins.lightDark(border-inline-end, 1px solid #DDD, none);
   }
 }
 
@@ -213,17 +211,17 @@ blockquote {
   position: relative;
   border-left: 4px solid transparent;
   border-left-color: var(--color-primary);
-  @include lightDark(background-color, #f8f8f8, #333);
-  padding: $-s $-m $-s $-xl;
+  @include mixins.lightDark(background-color, #f8f8f8, #333);
+  padding: vars.$s vars.$m vars.$s vars.$xl;
   overflow: auto;
   &:before {
     content: "\201C";
     font-size: 2em;
     font-weight: bold;
     position: absolute;
-    top: $-s;
-    left: $-s;
-    color: lighten($text-dark, 20%);
+    top: vars.$s;
+    left: vars.$s;
+    color: #777;
   }
 }
 
@@ -243,8 +241,8 @@ blockquote {
   font-size: 0.84em;
   border: 1px solid #DDD;
   border-radius: 3px;
-  @include lightDark(background-color, #f8f8f8, #2b2b2b);
-  @include lightDark(border-color, #DDD, #444);
+  @include mixins.lightDark(background-color, #f8f8f8, #2b2b2b);
+  @include mixins.lightDark(border-color, #DDD, #444);
 }
 
 code {
@@ -257,7 +255,7 @@ code {
 
 span.code {
   @extend .code-base;
-  padding: 1px $-xs;
+  padding: 1px vars.$xs;
 }
 
 pre code {
@@ -277,8 +275,8 @@ span.highlight {
  * Lists
  */
 ul, ol {
-  padding-left: $-m * 2.0;
-  padding-right: $-m * 2.0;
+  padding-left: vars.$m * 2.0;
+  padding-right: vars.$m * 2.0;
   display: flow-root;
   p {
     margin: 0;
@@ -305,19 +303,30 @@ li > ol, li > ul {
   margin-block-start: 0;
   padding-block-end: 0;
   padding-block-start: 0;
-  padding-left: $-m * 1.2;
-  padding-right: $-m * 1.2;
+  padding-left: vars.$m * 1.2;
+  padding-right: vars.$m * 1.2;
 }
 
+/**
+ * Checkbox lists
+ * Some styles duplicated for supporting logical units (eg. inline-end) while
+ * providing fallbacks to non-logical rules, so RTL is natively supported where possible.
+ */
 li.checkbox-item, li.task-list-item {
   display: list-item;
   list-style: none;
-  margin-left: -($-m * 1.2);
+  margin-left: -(vars.$m * 1.2);
+  margin-inline-start: -(vars.$m * 1.2);
+  margin-inline-end: 0;
   input[type="checkbox"] {
-    margin-right: $-xs;
+    margin-right: vars.$xs;
+    margin-inline-end: vars.$xs;
+    margin-inline-start: 0;
   }
   li.checkbox-item, li.task-list-item {
-    margin-left: $-xs;
+    margin-left: vars.$xs;
+    margin-inline-start: vars.$xs;
+    margin-inline-end: 0;
   }
 }
 
@@ -338,8 +347,8 @@ li.checkbox-item, li.task-list-item {
   text-align: end;
 }
 
-@each $sizeLetter, $size in $screen-sizes {
-  @include larger-than($size) {
+@each $sizeLetter, $size in vars.$screen-sizes {
+  @include mixins.larger-than($size) {
     .text-#{$sizeLetter}-center {
       text-align: center;
     }
@@ -365,6 +374,7 @@ li.checkbox-item, li.task-list-item {
 }
 
 .break-text {
+  white-space: normal;
   word-wrap: break-word;
   overflow-wrap: break-word;
 }
@@ -388,7 +398,7 @@ li.checkbox-item, li.task-list-item {
  * Grouping
  */
 .header-group {
-  margin: $-m 0;
+  margin: vars.$m 0;
   h1, h2, h3, h4, h5, h6 {
     margin: 0;
   }
@@ -396,7 +406,7 @@ li.checkbox-item, li.task-list-item {
 
 span.sep {
   color: #BBB;
-  padding: 0 $-xs;
+  padding: 0 vars.$xs;
 }
 
 .list > * {
@@ -412,7 +422,7 @@ span.sep {
   display: inline-block;
   position: relative;
   bottom: -0.105em;
-  margin-inline-end: $-xs;
+  margin-inline-end: vars.$xs;
   pointer-events: none;
   fill: currentColor;
 }