Skip to content

A platform for community discussion. Free, open, simple.

UX: New brand styles on wizard (#37229)

Derek Rushforthf5b01bc02a81
diff --git a/app/assets/stylesheets/wizard.scss b/app/assets/stylesheets/wizard.scss
index 6b09384546e..9fa0417739e 100644
--- a/app/assets/stylesheets/wizard.scss
+++ b/app/assets/stylesheets/wizard.scss
@@ -1,7 +1,14 @@
@use "lib/viewport";
-$blob-bg: absolute-image-url("/branded-background.svg");
-$blob-mobile-bg: absolute-image-url("/branded-background-mobile.svg");
+:root {
+ --wizard-primary: #7b5fe2;
+ --wizard-primary-100: #f4f2fc;
+ --wizard-primary-300: #b8a4ff;
+ --wizard-primary-400: #8b6df8;
+ --wizard-bg-color: #f9f8fc;
+ --wizard-bg-color-2: #e1d5ff;
+ --wizard-input-radius: 8px;
+}
@keyframes bump {
0% {
@@ -24,25 +31,14 @@ $blob-mobile-bg: absolute-image-url("/branded-background-mobile.svg");
}
}
+html:has(body.wizard) {
+ background-color: var(--wizard-bg-color);
+}
+
body.wizard {
- background-color: var(--secondary);
- background-image: $blob-bg;
- background-size: 110vw 110vh; // crops better than cover at various viewport sizes
- background-repeat: no-repeat;
- background-position: bottom;
+ background-color: var(--wizard-bg-color);
color: var(--primary-very-high);
- .wrap {
- max-width: 100%;
- }
-
- @include viewport.until(sm) {
- background: $blob-mobile-bg;
- background-size: cover;
- background-repeat: no-repeat;
- background-position: bottom;
- }
-
#wizard-main {
display: flex;
flex-direction: column;
@@ -57,21 +53,48 @@ body.wizard {
}
}
- .discourse-logo svg {
- position: relative;
- height: 50px;
- width: auto;
-
- @include viewport.until(sm) {
- height: 50px;
+ #main-outlet-wrapper {
+ @include viewport.until(md) {
+ gap: 0;
+ padding-inline: 0.5em;
}
+ }
+
+ .discourse-logo {
+ z-index: z("header");
+
+ svg {
+ height: 40px;
+ width: auto;
- @media screen and (height <= 900px) {
- .desktop-view & {
- display: none;
+ @include viewport.until(sm) {
+ height: 40px;
+ }
+
+ @media screen and (height <= 900px) {
+ .desktop-view & {
+ display: none;
+ }
}
}
}
+
+ &::before {
+ content: "";
+ display: block;
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ height: 600px;
+ background: linear-gradient(
+ to bottom,
+ var(--wizard-bg-color-2) 0%,
+ var(--wizard-bg-color) 100%
+ );
+ z-index: z("base");
+ pointer-events: none;
+ }
}
// Refactored SCSS
@@ -79,14 +102,13 @@ body.wizard {
position: relative;
z-index: 11;
background-color: var(--secondary);
- box-shadow: 0 4px 19px 6px rgb(0, 0, 0, 0.05);
+ box-shadow: 0 10px 30px rgb(123, 95, 226, 0.15);
box-sizing: border-box;
margin: 1em auto;
- border: 1px solid var(--content-border-color);
- border-radius: 8px;
- padding: 2em;
+ border-radius: 16px;
+ padding: 3em;
- @include viewport.until(lg) {
+ @include viewport.until(md) {
padding: 2em 1.5em;
}
@@ -95,10 +117,6 @@ body.wizard {
max-width: 700px;
width: 100%;
- @include viewport.until(lg) {
- max-width: 95%;
- }
-
.wizard-container__button:not(.wizard-container__button-upload) {
@include viewport.until(sm) {
width: 100%;
@@ -112,7 +130,7 @@ body.wizard {
}
&__field {
- margin-bottom: 1em;
+ margin-bottom: 2em;
}
&__field.invalid input {
@@ -127,6 +145,7 @@ body.wizard {
&__field label {
display: block;
+ margin-bottom: 0.5em;
}
&__step-form {
@@ -141,23 +160,14 @@ body.wizard {
&__step-header {
text-align: center;
margin-bottom: 3em;
-
- &--emoji img {
- width: 40px;
- height: 40px;
- margin-bottom: 1em;
- }
}
&__step-title {
- font-size: 2.5em;
+ font-size: 2em;
color: var(--primary);
line-height: var(--line-height-medium);
margin: 0 0 0.5em 0;
-
- @include viewport.until(lg) {
- font-size: var(--font-up-5);
- }
+ font-weight: 900;
}
&__step-container {
@@ -169,7 +179,6 @@ body.wizard {
&__step-contents {
min-height: 37em;
- margin-bottom: 2em;
@include viewport.until(sm) {
min-height: 30em;
@@ -205,7 +214,10 @@ body.wizard {
}
&__button {
- font-size: var(--font-up-1);
+ --accent-color: var(--wizard-primary);
+ width: 100%;
+ padding: 0.75em 2em;
+ font-weight: bold;
}
&__button.small {
@@ -213,13 +225,17 @@ body.wizard {
font-size: var(--font-down-1);
}
- &__button:hover,
+ &__button:hover {
+ --accent-color: var(--wizard-primary-400);
+ --button-box-shadow: none;
+ }
+
&__button:focus {
- background-color: var(--primary-low);
+ --button-box-shadow: var(--wizard-primary-300);
}
&__button:active {
- background-color: var(--primary-low-mid);
+ --accent-color: var(--wizard-primary);
}
&__button:disabled,
@@ -241,7 +257,7 @@ body.wizard {
&__label {
font-weight: bold;
- font-size: var(--font-up-1);
+ color: var(--primary);
}
&__label.required {
@@ -253,7 +269,7 @@ body.wizard {
color: var(--primary-high);
font-size: var(--font-0);
font-weight: normal;
- margin: 0.25em 0 0.5em 0;
+ margin: 0.25em 0 1em;
a {
margin: 0;
@@ -274,23 +290,31 @@ body.wizard {
}
}
- &__text-input {
- border-radius: 4px !important;
+ &__text-input,
+ input[type="text"] {
+ --accent-color: var(--wizard-primary);
+ --d-input-border-radius: var(--wizard-input-radius);
+ --d-input-border: 1px solid var(--primary-300);
width: 100%;
- font-size: var(--font-up-1);
margin: 0;
- padding: 10px;
- background-color: var(--secondary);
- border: 1px solid var(--primary-low-mid);
+ padding: 0.75em;
}
&__dropdown {
width: 100%;
- height: 38px;
}
&__dropdown .select-kit-header:not(.btn) {
- border-radius: 4px;
+ --d-input-focused-color: var(--wizard-primary);
+ border-radius: var(--wizard-input-radius);
+ padding: 0.75em;
+ height: auto;
+ border-color: var(--primary-300);
+
+ .name {
+ font-weight: 400;
+ color: var(--d-input-text-color);
+ }
}
&__radio {
@@ -319,23 +343,25 @@ body.wizard {
&.--selected {
.wizard-container__label {
- background-color: var(--tertiary-very-low);
- border-color: var(--tertiary-high);
+ background-color: var(--wizard-primary-100);
+ border-color: var(--wizard-primary);
border-width: 2px;
margin: 0;
+ color: var(--wizard-primary);
+ font-weight: bold;
}
}
&:focus-within {
.wizard-container__label {
- outline: 2px solid var(--d-input-focused-color);
+ outline: 2px solid var(--wizard-primary);
outline-offset: 2px;
}
}
.wizard-container__label {
- border-radius: 4px;
- border: 1px solid var(--primary-low-mid);
+ border-radius: var(--wizard-input-radius);
+ border: 1px solid var(--primary-300);
flex-grow: 1;
margin: 1px 0;
}
diff --git a/frontend/discourse/app/static/wizard/components/wizard-step.gjs b/frontend/discourse/app/static/wizard/components/wizard-step.gjs
index 48e68b0493a..3268eca19bd 100644
--- a/frontend/discourse/app/static/wizard/components/wizard-step.gjs
+++ b/frontend/discourse/app/static/wizard/components/wizard-step.gjs
@@ -3,7 +3,6 @@ import { tracked } from "@glimmer/tracking";
import { on } from "@ember/modifier";
import { action } from "@ember/object";
import concatClass from "discourse/helpers/concat-class";
-import emoji from "discourse/helpers/emoji";
import getUrl from "discourse/lib/get-url";
import { i18n } from "discourse-i18n";
import WizardField from "./wizard-field";
@@ -58,9 +57,6 @@ export default class WizardStepComponent extends Component {
<div class={{concatClass "wizard-container" this.containerFontClasses}}>
<div class="wizard-container__step-contents">
<div class="wizard-container__step-header">
- <div class="wizard-container__step-header--emoji">
- {{emoji @step.emoji}}
- </div>
<h1 class="wizard-container__step-title">{{@step.title}}</h1>
</div>
diff --git a/public/images/branded-background-mobile.svg b/public/images/branded-background-mobile.svg
deleted file mode 100644
index 4962535d595..00000000000
--- a/public/images/branded-background-mobile.svg
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="390" height="844" viewBox="0 0 390 844">
- <path d="M65.11,755.03c-.95,0-1.9,.08-2.87,.23-10.9,1.74-20.73,12.53-18.33,27.56,2.4,15.03,16.43,23.52,27.44,21.76,5.23-.84,9.15-3.57,11.65-8.12,2.72-4.93,3.55-11.8,2.36-19.32-1.19-7.39-4.29-13.63-8.75-17.6-3.35-2.98-7.28-4.52-11.49-4.52h-.01Zm3.05,65.41c-18.96,0-36.43-14.97-39.65-35.14-3.53-22.1,10.2-42.06,31.26-45.43,9.94-1.58,19.59,1.27,27.2,8.04,7.14,6.35,12.04,15.87,13.78,26.78,1.78,11.1,.36,21.23-4.08,29.3-4.8,8.74-12.92,14.41-22.86,16-1.89,.3-3.77,.45-5.65,.45h0Z"/>
- <path d="M118.58,461.13c0,42.64-27.43,60.69-72.35,60.69s-101.49-63.7-101.49-106.34,70.65-54.87,115.57-54.87,58.27,57.88,58.27,100.52h0Z" style="fill: #0ca64e; fill-rule: evenodd;"/>
- <path d="M492.26,712.49c-90.96,16.64-161.99-38.28-219.31-142.86-47.68-87.02,25.41-193.64,97.18-244.1,80.59-56.65,193.7,26.32,248.35,183.9,32.51,93.76-28.61,185.21-126.22,203.06h0Z" style="fill: #e84a51; fill-rule: evenodd;"/>
- <path d="M393,717.3c-17.29,16.8-36.86,24.94-53.76,12.76s-19.47-31.75-3.5-49.8c15.58-17.6,37.62-33.19,54.52-21.02,16.9,12.18,20.84,40.46,2.74,58.05h0Z" style="fill: #fbf5af; fill-rule: evenodd;"/>
- <path d="M69.29,124.46c0,19.4-22.98,39.33-40.94,39.33S-9.71,147.18-9.71,127.78s25.03-43.21,42.99-43.21,36.01,20.49,36.01,39.89Z" style="fill: #f0794a; fill-rule: evenodd;"/>
-</svg>
\ No newline at end of file
diff --git a/public/images/branded-background.svg b/public/images/branded-background.svg
deleted file mode 100644
index 16e04279f69..00000000000
--- a/public/images/branded-background.svg
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="1906.75" height="980" viewBox="0 0 1906.75 980">
- <path d="M488.66,863.09c-.95,0-1.9,.08-2.87,.23-10.9,1.74-20.73,12.53-18.33,27.56,2.4,15.03,16.43,23.52,27.44,21.76,5.23-.84,9.15-3.57,11.65-8.12,2.72-4.93,3.55-11.8,2.36-19.32-1.19-7.39-4.29-13.63-8.75-17.6-3.35-2.98-7.28-4.52-11.49-4.52Zm3.05,65.4c-18.96,0-36.43-14.97-39.65-35.14-3.53-22.1,10.2-42.06,31.26-45.43,9.94-1.58,19.59,1.27,27.2,8.04,7.14,6.35,12.04,15.87,13.78,26.78,1.78,11.1,.36,21.23-4.08,29.3-4.8,8.74-12.92,14.41-22.86,16-1.89,.3-3.77,.45-5.65,.45Z"/>
- <path d="M252.13,687.19c0,42.64-27.43,60.69-72.35,60.69s-101.49-63.7-101.49-106.34,70.65-54.87,115.57-54.87,58.27,57.88,58.27,100.52Z" style="fill: #0ca64e; fill-rule: evenodd;"/>
- <path d="M1849.08,829.55c-90.96,16.64-161.99-38.28-219.31-142.86-47.68-87.02,25.41-193.64,97.18-244.1,80.59-56.65,193.7,26.32,248.35,183.9,32.51,93.76-28.61,185.21-126.22,203.06Z" style="fill: #e84a51; fill-rule: evenodd;"/>
- <path d="M1749.82,834.36c-17.29,16.8-36.86,24.94-53.76,12.76-16.9-12.18-19.47-31.75-3.5-49.8,15.58-17.6,37.62-33.19,54.52-21.02,16.9,12.18,20.84,40.46,2.74,58.05Z" style="fill: #fbf5af; fill-rule: evenodd;"/>
- <path d="M269.84,223.52c0,19.4-22.98,39.33-40.94,39.33s-38.06-16.61-38.06-36.01,25.03-43.21,42.99-43.21,36.01,20.49,36.01,39.89Z" style="fill: #f0794a; fill-rule: evenodd;"/>
-</svg>
\ No newline at end of file