From 16540f57f0c2a09344f6c69223efc4b7a75f78f7 Mon Sep 17 00:00:00 2001 From: "Luna D." Date: Tue, 17 Dec 2024 19:35:47 +0100 Subject: [PATCH] review fixes --- assets/css/common/measurements.css | 12 +++-- assets/css/common/mixins.css | 8 ++-- assets/css/elements/base.css | 22 ++++----- assets/css/elements/burger.css | 4 +- assets/css/elements/header.css | 4 +- assets/css/elements/layout.css | 4 +- assets/css/elements/media.css | 2 +- assets/css/elements/shame.css | 4 +- assets/css/themes/dark-blue.css | 2 +- assets/css/themes/dark-cyan.css | 2 +- assets/css/themes/dark-green.css | 2 +- assets/css/themes/dark-orange.css | 2 +- assets/css/themes/dark-pink.css | 2 +- assets/css/themes/dark-purple.css | 2 +- assets/css/themes/dark-red.css | 2 +- assets/css/themes/dark-silver.css | 2 +- assets/css/themes/dark-yellow.css | 2 +- assets/css/themes/light-blue.css | 2 +- assets/css/themes/light-cyan.css | 2 +- assets/css/themes/light-green.css | 2 +- assets/css/themes/light-orange.css | 2 +- assets/css/themes/light-pink.css | 2 +- assets/css/themes/light-purple.css | 2 +- assets/css/themes/light-red.css | 2 +- assets/css/themes/light-silver.css | 2 +- assets/css/themes/light-yellow.css | 2 +- assets/css/views/commissions.css | 2 +- assets/css/views/posts.css | 2 +- assets/css/views/profiles.css | 6 +-- assets/css/views/tags.css | 8 ++-- lib/philomena/users/user.ex | 19 ++++++-- .../templates/setting/edit.html.slime | 5 ++- lib/philomena_web/views/layout_view.ex | 24 ++-------- lib/philomena_web/views/setting_view.ex | 45 ++++++------------- .../20241216165826_convert_user_themes.exs | 8 ++++ 35 files changed, 103 insertions(+), 112 deletions(-) diff --git a/assets/css/common/measurements.css b/assets/css/common/measurements.css index 235c3877f..da6130051 100644 --- a/assets/css/common/measurements.css +++ b/assets/css/common/measurements.css @@ -6,6 +6,10 @@ $max-limited-desktop-width: 1150px; $min-desktop-width: 800px; $limited-layout-width: 980px; $min-desktop-thumb-width: 700px; +$image-tiny-size: 64px; +$image-small-size: 128px; +$image-medium-size: 256px; +$image-large-size: 512px; :root { --medium-layout-width: $medium-layout-width; @@ -22,10 +26,10 @@ $min-desktop-thumb-width: 700px; --padding-normal: 1em; --centered-margin: 24px; --normal-margin: 12px; - --image-tiny-size: 64px; - --image-small-size: 128px; - --image-medium-size: 256px; - --image-large-size: 512px; + --image-tiny-size: $image-tiny-size; + --image-small-size: $image-small-size; + --image-medium-size: $image-medium-size; + --image-large-size: $image-large-size; --header-height: 36px; --header-field-height: 28px; --header-sub-height: 32px; diff --git a/assets/css/common/mixins.css b/assets/css/common/mixins.css index 18088f26d..5fa70103a 100644 --- a/assets/css/common/mixins.css +++ b/assets/css/common/mixins.css @@ -1,8 +1,8 @@ @define-mixin image-alt-size $name, $size { - @media (min-width: $(size)) { + @media (min-width: $size) { img[alt="$(name)"] { - max-height: $(size) !important; - max-width: $(size) !important; + max-height: $size !important; + max-width: $size !important; } } } @@ -67,7 +67,7 @@ background: $(color); } -/* 16x16 checkerboard */ +/* 16x16 checkerboard */ @define-mixin img-checkerboard-background { img { background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAGUlEQVR42mP474AKGdDhCFGALoChYWQoAACpW7+B5lv5BwAAAABJRU5ErkJggg=="); diff --git a/assets/css/elements/base.css b/assets/css/elements/base.css index 2d6fb909f..09c6a429f 100644 --- a/assets/css/elements/base.css +++ b/assets/css/elements/base.css @@ -47,7 +47,7 @@ h4 { margin-bottom: 0.5em; } -/* Slightly dirty, no clean way to strip top margins off headers though */ +/* Slightly dirty, no clean way to strip top margins off headers though */ .remove-top-margin { margin-top: 0; } @@ -201,7 +201,7 @@ hr { background: var(--danger-light-color); border-color: var(--danger-color); } -/* Make HTML lists with multi-line text readable */ +/* Make HTML lists with multi-line text readable */ .rule ul { margin: 0; padding: 5px 20px; @@ -237,7 +237,7 @@ hr { } } -/* Text Editor */ +/* Text Editor */ blockquote { margin: 1em 2em; border: 1px dotted var(--foreground-color); @@ -253,13 +253,13 @@ blockquote .paragraph:last-child { margin-bottom: 0; } -/* Prevent blockquote from gaining far too much indentation and breaking. */ +/* Prevent blockquote from gaining far too much indentation and breaking. */ blockquote blockquote blockquote blockquote blockquote blockquote { margin: 1em 0; padding: 1em 2px; } -/* Horizontal space is at a high premium on mobile. */ +/* Horizontal space is at a high premium on mobile. */ @media (max-width: $min-desktop-width) { blockquote { margin: 1em 4px; @@ -329,10 +329,12 @@ blockquote blockquote blockquote blockquote blockquote blockquote { margin-bottom: 6px; } -@mixin image-alt-size tiny, var(--image-tiny-size); -@mixin image-alt-size small, var(--image-small-size); -@mixin image-alt-size medium, var(--image-medium-size); -@mixin image-alt-size large, var(--image-large-size); +/* We need to use $variables here because @media tags + * do not work with CSS3 custom properties (variables) */ +@mixin image-alt-size tiny, $image-tiny-size; +@mixin image-alt-size small, $image-small-size; +@mixin image-alt-size medium, $image-medium-size; +@mixin image-alt-size large, $image-large-size; /* code styling */ /* You might be asking what's up with this silly mixin @@ -443,7 +445,7 @@ i.favicon-home { display: inline-block; } -/* changelog */ +/* changelog */ .commit-sha { background: var(--assistant-color); border: 1px solid var(--assistant-border-color); diff --git a/assets/css/elements/burger.css b/assets/css/elements/burger.css index f081cd9cb..d72d822db 100644 --- a/assets/css/elements/burger.css +++ b/assets/css/elements/burger.css @@ -8,7 +8,7 @@ display: none; } -/* content sliding open */ +/* content sliding open */ #container.open { @mixin transform-n-animation open, 0.4s, translate(210px, 0); } @@ -23,7 +23,7 @@ } } -/* content closing */ +/* content closing */ #container.close { animation: close 0.3s ease-in-out; } diff --git a/assets/css/elements/header.css b/assets/css/elements/header.css index 401c99a09..223b052c5 100644 --- a/assets/css/elements/header.css +++ b/assets/css/elements/header.css @@ -18,7 +18,7 @@ color: var(--unread-message-color); } -/* For text preceded by an icon */ +/* For text preceded by an icon */ .fa__text { padding-left: 6px; } @@ -98,7 +98,7 @@ select.header__input:focus optgroup { .header__search__button, .header__search__button:visited { border: none; - /* Chrome loves extra padding for some reason */ + /* Chrome loves extra padding for some reason */ padding-top: 0; padding-bottom: 0; line-height: var(--header-field-height); diff --git a/assets/css/elements/layout.css b/assets/css/elements/layout.css index 4766e397d..367fa248a 100644 --- a/assets/css/elements/layout.css +++ b/assets/css/elements/layout.css @@ -125,7 +125,7 @@ nav { } /* Use the following two classes to center content when user has layout centering enabled: */ -/* TODO replace this bullshit naming, this is not actually BEM at all and makes no sense */ +/* TODO replace this bullshit naming, this is not actually BEM at all and makes no sense */ #container.layout--center-aligned .center--layout { justify-content: center; margin-left: auto; @@ -188,7 +188,7 @@ nav { justify-content: center; } -/* Mostly for the header */ +/* Mostly for the header */ .flex--start-bunched { justify-content: flex-start; } diff --git a/assets/css/elements/media.css b/assets/css/elements/media.css index d7e5e7dc3..a4b4158c6 100644 --- a/assets/css/elements/media.css +++ b/assets/css/elements/media.css @@ -62,7 +62,7 @@ a.media-box__header--link:hover { background-color: var(--success-color); } -/* TODO: properly fix this */ +/* TODO: properly fix this */ .media-box__content .image-container { width: 100%; height: 100%; diff --git a/assets/css/elements/shame.css b/assets/css/elements/shame.css index 092deb6cb..95518174f 100644 --- a/assets/css/elements/shame.css +++ b/assets/css/elements/shame.css @@ -1,5 +1,5 @@ -/* For more shame related to this, see the