From a09ed7f709cd71101c0352f10098c7e970d86d29 Mon Sep 17 00:00:00 2001 From: Muhammad Farhan Khan Date: Sat, 21 Sep 2024 17:22:00 +0500 Subject: [PATCH] feat!: Dropping Sass support from builtin html block, replacing with vanilla CSS --- xmodule/assets/editor/_edit.scss | 12 ++++----- xmodule/assets/html/_display.scss | 44 +++++++++++++++---------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/xmodule/assets/editor/_edit.scss b/xmodule/assets/editor/_edit.scss index 71699776522d..9ecd31416ced 100644 --- a/xmodule/assets/editor/_edit.scss +++ b/xmodule/assets/editor/_edit.scss @@ -18,7 +18,7 @@ @include linear-gradient(top, #d4dee8, #c9d5e2); position: relative; - padding: ($baseline/4); + padding: calc((var(--baseline)/4)); border-bottom-color: #a5aaaf; button { @@ -26,7 +26,7 @@ @include float(left); - padding: 3px ($baseline/2) 5px; + padding: 3px calc((var(--baseline)/2)) 5px; margin-left: 7px; border: 0; border-radius: 2px; @@ -53,7 +53,7 @@ li { @include float(left); - @include margin-right($baseline/4); + @include margin-right(calc((var(--baseline)/4))); &:last-child { @include margin-right(0); @@ -67,7 +67,7 @@ border: 1px solid #a5aaaf; border-radius: 3px 3px 0 0; - @include linear-gradient(top, $transparent 87%, rgba(0, 0, 0, .06)); + @include linear-gradient(top, var(--transparent) 87%, rgba(0, 0, 0, .06)); background-color: #e5ecf3; font-size: 13px; @@ -75,8 +75,8 @@ box-shadow: 1px -1px 1px rgba(0, 0, 0, .05); &.current { - background: $white; - border-bottom-color: $white; + background: var(--white); + border-bottom-color: var(--white); } } } diff --git a/xmodule/assets/html/_display.scss b/xmodule/assets/html/_display.scss index 25e2ce4fbd64..beceaa1d0119 100644 --- a/xmodule/assets/html/_display.scss +++ b/xmodule/assets/html/_display.scss @@ -10,8 +10,8 @@ } h1 { - color: $body-color; - font: normal 2em/1.4em $font-family-sans-serif; + color: var(--body-color); + font: normal 2em/1.4em var(--font-family-sans-serif); letter-spacing: 1px; @include margin(0, 0, 1.416em, 0); @@ -19,9 +19,9 @@ h1 { h2 { color: #646464; - font: normal 1.2em/1.2em $font-family-sans-serif; + font: normal 1.2em/1.2em var(--font-family-sans-serif); letter-spacing: 1px; - margin-bottom: ($baseline*0.75); + margin-bottom: calc((var(--baseline)*0.75)); -webkit-font-smoothing: antialiased; } @@ -29,7 +29,7 @@ h3, h4, h5, h6 { - @include margin(0, 0, ($baseline/2), 0); + @include margin(0, 0, calc((var(--baseline)/2)), 0); font-weight: 600; } @@ -54,7 +54,7 @@ p { margin-bottom: 1.416em; font-size: 1em; line-height: 1.6em !important; - color: $body-color; + color: var(--body-color); } em, @@ -78,11 +78,11 @@ b { p + p, ul + p, ol + p { - margin-top: $baseline; + margin-top: var(--baseline); } blockquote { - margin: 1em ($baseline*2); + margin: 1em calc((var(--baseline)*2)); } ol, @@ -91,7 +91,7 @@ ul { @include bi-app-compact(padding, 0, 0, 0, 1em); margin: 1em 0; - color: $body-color; + color: var(--body-color); li { margin-bottom: 0.708em; @@ -112,7 +112,7 @@ a { &:hover, &:active, &:focus { - color: $blue; + color: var(--blue); } } @@ -122,7 +122,7 @@ img { pre { margin: 1em 0; - color: $body-color; + color: var(--body-color); font-family: monospace, serif; font-size: 1em; white-space: pre-wrap; @@ -130,7 +130,7 @@ pre { } code { - color: $body-color; + color: var(--body-color); font-family: monospace, serif; background: none; padding: 0; @@ -138,15 +138,15 @@ code { table { width: 100%; - margin: $baseline 0; + margin: var(--baseline) 0; border-collapse: collapse; font-size: 16px; td, th { - margin: $baseline 0; - padding: ($baseline/2); - border: 1px solid $gray-l3; + margin: var(--baseline) 0; + padding: calc((var(--baseline)/2)); + border: 1px solid var(--gray-l3); font-size: 14px; &.cont-justified-left { @@ -179,12 +179,12 @@ th { position: absolute; display: block; - padding: ($baseline/4) 7px; + padding: calc((var(--baseline)/4)) 7px; border-radius: 5px; opacity: 0.9; - background: $white; - color: $black; - border: 2px solid $black; + background: var(--white); + color: var(--black); + border: 2px solid var(--black); .label { font-weight: bold; @@ -269,11 +269,11 @@ th { position: relative; &.action-zoom-in { - margin-right: ($baseline/4); + margin-right: calc((var(--baseline)/4)); } &.action-zoom-out { - margin-left: ($baseline/4); + margin-left: calc((var(--baseline)/4)); } &.is-disabled {