SCSS: Refactor .is-code by moving it to helper file and renaming it

This commit is contained in:
Molkobain
2021-05-05 18:29:33 +02:00
parent 6ab6930986
commit 88634bcd92
3 changed files with 11 additions and 10 deletions

View File

@@ -16,9 +16,6 @@
* You should have received a copy of the GNU Affero General Public License
*/
$ibo-code--background-color: $ibo-color-white-200 !default;
$ibo-code--padding: 1.25rem 1.5rem !default;
/* Note: We have to wrap it in the ID in order to overload its rules, otherwise, the ID takes over the simple CSS class... */
#ibo-center-container {
&.ibo-center-container--with-side-content {
@@ -45,9 +42,3 @@ $ibo-code--padding: 1.25rem 1.5rem !default;
background-color: $ibo-content-block--background-color;
border-left: $ibo-content-block--border;
}
.ibo-code {
background-color: $ibo-code--background-color;
padding: $ibo-code--padding;
@extend %ibo-font-code-150;
}

View File

@@ -16,6 +16,10 @@
* You should have received a copy of the GNU Affero General Public License
*/
/* SCSS variables */
$ibo-is-code--background-color: $ibo-color-white-200 !default;
$ibo-is-code--padding: 1.25rem 1.5rem !default;
/**************/
/* Visibility */
/**************/
@@ -116,6 +120,12 @@ body.ibo-has-fullscreen-descendant {
}
}
.ibo-is-code {
background-color: $ibo-is-code--background-color;
padding: $ibo-is-code--padding;
@extend %ibo-font-code-150;
}
%ibo-medallion {
position: relative;
border-radius: var(--ibo-border-radius-full);

View File

@@ -31,7 +31,7 @@ class UIContentBlockUIBlockFactory extends AbstractUIBlockFactory
*/
public static function MakeForCode(string $sCode, string $sId = null)
{
$oCode = new UIContentBlock($sId, ['ibo-code']);
$oCode = new UIContentBlock($sId, ['ibo-is-code']);
$sCode = str_replace("\n", '<br>', $sCode);
$oCode->AddSubBlock(new Html($sCode));