mirror of
https://github.com/penpot/penpot.git
synced 2025-05-08 17:35:52 +02:00
♻️ Refactor css
This commit is contained in:
parent
30e1c3b4ff
commit
a75c32fa67
6 changed files with 72 additions and 95 deletions
|
@ -19,28 +19,24 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.separator {
|
.separator {
|
||||||
border-color: $db-quaternary;
|
border-color: var(--modal-separator-backogrund-color);
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.error-wrapper {
|
|
||||||
padding-block-end: $s-8;
|
|
||||||
}
|
|
||||||
|
|
||||||
.auth-title {
|
.auth-title {
|
||||||
@include bigTitleTipography;
|
@include bigTitleTipography;
|
||||||
color: $df-primary;
|
color: var(--title-foreground-color-hover);
|
||||||
}
|
}
|
||||||
|
|
||||||
.auth-subtitle {
|
.auth-subtitle {
|
||||||
font-size: $fs-14;
|
@include smallTitleTipography;
|
||||||
color: $df-secondary;
|
color: var(--title-foreground-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.auth-tagline {
|
.auth-tagline {
|
||||||
@include smallTitleTipography;
|
@include smallTitleTipography;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
color: $df-secondary;
|
color: var(--title-foreground-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-field {
|
.form-field {
|
||||||
|
@ -50,46 +46,32 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.buttons-stack {
|
.buttons-stack {
|
||||||
display: flex;
|
display: grid;
|
||||||
flex-direction: column;
|
|
||||||
gap: $s-8;
|
gap: $s-8;
|
||||||
|
}
|
||||||
|
|
||||||
button,
|
.login-button,
|
||||||
:global(.btn-primary) {
|
.login-ldap-button {
|
||||||
@extend .button-primary;
|
@extend .button-primary;
|
||||||
font-size: $fs-11;
|
@include uppercaseTitleTipography;
|
||||||
height: $s-40;
|
height: $s-40;
|
||||||
text-transform: uppercase;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.link-entry {
|
.demo-account,
|
||||||
|
.go-back {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: $s-12;
|
gap: $s-12;
|
||||||
border-top: $s-1 solid $db-quaternary;
|
|
||||||
|
|
||||||
span {
|
|
||||||
text-align: center;
|
|
||||||
font-size: $fs-14;
|
|
||||||
color: $df-secondary;
|
|
||||||
}
|
|
||||||
a {
|
|
||||||
@extend .button-secondary;
|
|
||||||
height: $s-40;
|
|
||||||
text-transform: uppercase;
|
|
||||||
font-size: $fs-11;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.go-back {
|
|
||||||
border-top: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.demo-account {
|
|
||||||
padding: 0;
|
padding: 0;
|
||||||
border-top: none;
|
border-block-start: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.demo-account-link,
|
||||||
|
.go-back-link {
|
||||||
|
@extend .button-secondary;
|
||||||
|
@include uppercaseTitleTipography;
|
||||||
|
height: $s-40;
|
||||||
}
|
}
|
||||||
|
|
||||||
.links {
|
.links {
|
||||||
|
@ -98,7 +80,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.register,
|
.register,
|
||||||
.account {
|
.account,
|
||||||
|
.recovery-request {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
gap: $s-8;
|
gap: $s-8;
|
||||||
|
@ -106,21 +89,23 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.register-text,
|
.register-text,
|
||||||
.account-text {
|
.account-text,
|
||||||
|
.recovery-text {
|
||||||
|
@include smallTitleTipography;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
font-size: $fs-14;
|
color: var(--title-foreground-color);
|
||||||
color: $df-secondary;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.register-link,
|
.register-link,
|
||||||
.account-link {
|
.account-link,
|
||||||
|
.recovery-link,
|
||||||
|
.forgot-pass-link {
|
||||||
|
@include smallTitleTipography;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
border: none;
|
border: none;
|
||||||
display: inline;
|
display: inline;
|
||||||
font-size: $fs-14;
|
color: var(--link-foreground-color);
|
||||||
color: $da-primary;
|
|
||||||
font-weight: $fw400;
|
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
|
@ -130,42 +115,33 @@
|
||||||
.forgot-password {
|
.forgot-password {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
a {
|
|
||||||
font-size: $fs-14;
|
|
||||||
color: $da-primary;
|
|
||||||
font-weight: $fw400;
|
|
||||||
}
|
|
||||||
&:hover {
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.submit-btn,
|
.submit-btn,
|
||||||
.register-btn,
|
.register-btn,
|
||||||
.recover-btn {
|
.recover-btn {
|
||||||
@extend .button-primary;
|
@extend .button-primary;
|
||||||
font-size: $fs-11;
|
@include uppercaseTitleTipography;
|
||||||
height: $s-40;
|
height: $s-40;
|
||||||
text-transform: uppercase;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-btn {
|
.login-btn {
|
||||||
border-radius: $br-8;
|
@include smallTitleTipography;
|
||||||
font-size: $fs-14;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: $s-6;
|
gap: $s-6;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-color: $db-tertiary;
|
border-radius: $br-8;
|
||||||
color: var(--app-white);
|
background-color: var(--button-secondary-background-color-rest);
|
||||||
|
color: var(--button-foreground-color-focus);
|
||||||
span {
|
span {
|
||||||
padding-top: $s-2;
|
padding-block-start: $s-2;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: var(--app-white);
|
color: var(--button-foreground-color-focus);
|
||||||
background-color: $db-quaternary;
|
background-color: var(--button-secondary-background-color-hover);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,7 +149,3 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: $s-8;
|
gap: $s-8;
|
||||||
}
|
}
|
||||||
|
|
||||||
.banner {
|
|
||||||
margin: $s-16 0;
|
|
||||||
}
|
|
||||||
|
|
|
@ -38,10 +38,9 @@
|
||||||
(mf/defc demo-warning
|
(mf/defc demo-warning
|
||||||
{::mf/props :obj}
|
{::mf/props :obj}
|
||||||
[]
|
[]
|
||||||
[:div {:class (stl/css :banner)}
|
|
||||||
[:& context-notification
|
[:& context-notification
|
||||||
{:type :warning
|
{:type :warning
|
||||||
:content (tr "auth.demo-warning")}]])
|
:content (tr "auth.demo-warning")}])
|
||||||
|
|
||||||
(defn- login-with-oidc
|
(defn- login-with-oidc
|
||||||
[event provider params]
|
[event provider params]
|
||||||
|
@ -166,12 +165,11 @@
|
||||||
|
|
||||||
[:*
|
[:*
|
||||||
(when-let [message @error]
|
(when-let [message @error]
|
||||||
[:div {:class (stl/css :error-wrapper)}
|
|
||||||
[:& context-notification
|
[:& context-notification
|
||||||
{:type :warning
|
{:type :warning
|
||||||
:content message
|
:content message
|
||||||
:data-test "login-banner"
|
:data-test "login-banner"
|
||||||
:role "alert"}]])
|
:role "alert"}])
|
||||||
|
|
||||||
[:& fm/form {:on-submit on-submit
|
[:& fm/form {:on-submit on-submit
|
||||||
:class (stl/css :login-form)
|
:class (stl/css :login-form)
|
||||||
|
@ -195,6 +193,7 @@
|
||||||
(contains? cf/flags :login-with-password)))
|
(contains? cf/flags :login-with-password)))
|
||||||
[:div {:class (stl/css :fields-row :forgot-password)}
|
[:div {:class (stl/css :fields-row :forgot-password)}
|
||||||
[:& lk/link {:action on-recovery-request
|
[:& lk/link {:action on-recovery-request
|
||||||
|
:class (stl/css :forgot-pass-link)
|
||||||
:data-test "forgot-password"}
|
:data-test "forgot-password"}
|
||||||
(tr "auth.forgot-password")]])
|
(tr "auth.forgot-password")]])
|
||||||
|
|
||||||
|
@ -209,6 +208,7 @@
|
||||||
(when (contains? cf/flags :login-with-ldap)
|
(when (contains? cf/flags :login-with-ldap)
|
||||||
[:> fm/submit-button*
|
[:> fm/submit-button*
|
||||||
{:label (tr "auth.login-with-ldap-submit")
|
{:label (tr "auth.login-with-ldap-submit")
|
||||||
|
:class (stl/css :login-ldap-button)
|
||||||
:on-click on-submit-ldap}])]]]))
|
:on-click on-submit-ldap}])]]]))
|
||||||
|
|
||||||
(mf/defc login-buttons
|
(mf/defc login-buttons
|
||||||
|
|
|
@ -93,6 +93,7 @@
|
||||||
[:& recovery-form {:params params}]
|
[:& recovery-form {:params params}]
|
||||||
|
|
||||||
[:div {:class (stl/css :links)}
|
[:div {:class (stl/css :links)}
|
||||||
[:div {:class (stl/css :link-entry :go-back)}
|
[:div {:class (stl/css :go-back)}
|
||||||
[:a {:on-click #(st/emit! (rt/nav :auth-login))}
|
[:a {:on-click #(st/emit! (rt/nav :auth-login))
|
||||||
|
:class (stl/css :go-back-link)}
|
||||||
(tr "profile.recovery.go-to-login")]]]])
|
(tr "profile.recovery.go-to-login")]]]])
|
||||||
|
|
|
@ -103,7 +103,8 @@
|
||||||
|
|
||||||
[:& recovery-form {:params params :on-success-callback on-success-callback}]
|
[:& recovery-form {:params params :on-success-callback on-success-callback}]
|
||||||
[:hr {:class (stl/css :separator)}]
|
[:hr {:class (stl/css :separator)}]
|
||||||
[:div {:class (stl/css :link-entry :go-back)}
|
[:div {:class (stl/css :go-back)}
|
||||||
[:& lk/link {:action go-back
|
[:& lk/link {:action go-back
|
||||||
|
:class (stl/css :go-back-link)
|
||||||
:data-test "go-back-link"}
|
:data-test "go-back-link"}
|
||||||
(tr "labels.go-back")]]]))
|
(tr "labels.go-back")]]]))
|
||||||
|
|
|
@ -153,7 +153,6 @@
|
||||||
[:div {:class (stl/css :links)}
|
[:div {:class (stl/css :links)}
|
||||||
[:div {:class (stl/css :account)}
|
[:div {:class (stl/css :account)}
|
||||||
[:span {:class (stl/css :account-text)} (tr "auth.already-have-account") " "]
|
[:span {:class (stl/css :account-text)} (tr "auth.already-have-account") " "]
|
||||||
|
|
||||||
[:& lk/link {:action #(st/emit! (rt/nav :auth-login {} params))
|
[:& lk/link {:action #(st/emit! (rt/nav :auth-login {} params))
|
||||||
:class (stl/css :account-link)
|
:class (stl/css :account-link)
|
||||||
:data-test "login-here-link"}
|
:data-test "login-here-link"}
|
||||||
|
@ -162,8 +161,9 @@
|
||||||
(when (contains? cf/flags :demo-users)
|
(when (contains? cf/flags :demo-users)
|
||||||
[:*
|
[:*
|
||||||
[:hr {:class (stl/css :separator)}]
|
[:hr {:class (stl/css :separator)}]
|
||||||
[:div {:class (stl/css :link-entry :demo-account)}
|
[:div {:class (stl/css :demo-account)}
|
||||||
[:& lk/link {:action #(st/emit! (du/create-demo-profile))}
|
[:& lk/link {:action #(st/emit! (du/create-demo-profile))
|
||||||
|
:class (stl/css :demo-account-link)}
|
||||||
(tr "auth.create-demo-account")]]])]])
|
(tr "auth.create-demo-account")]]])]])
|
||||||
|
|
||||||
;; --- PAGE: register validation
|
;; --- PAGE: register validation
|
||||||
|
@ -270,8 +270,9 @@
|
||||||
[:& register-validate-form {:params params}]
|
[:& register-validate-form {:params params}]
|
||||||
|
|
||||||
[:div {:class (stl/css :links)}
|
[:div {:class (stl/css :links)}
|
||||||
[:div {:class (stl/css :link-entry :go-back)}
|
[:div {:class (stl/css :go-back)}
|
||||||
[:& lk/link {:action #(st/emit! (rt/nav :auth-register {} {}))}
|
[:& lk/link {:action #(st/emit! (rt/nav :auth-register {} {}))
|
||||||
|
:class (stl/css :go-back-link)}
|
||||||
(tr "labels.go-back")]]]])
|
(tr "labels.go-back")]]]])
|
||||||
|
|
||||||
(mf/defc register-success-page
|
(mf/defc register-success-page
|
||||||
|
|
|
@ -78,19 +78,21 @@
|
||||||
:on-click close} i/close]]
|
:on-click close} i/close]]
|
||||||
|
|
||||||
[:div {:class (stl/css :modal-content)}
|
[:div {:class (stl/css :modal-content)}
|
||||||
|
|
||||||
(case current-section
|
(case current-section
|
||||||
:login
|
:login
|
||||||
[:div {:class (stl/css :form-container)}
|
[:div {:class (stl/css :form-container)}
|
||||||
[:& login-methods {:on-success-callback success-login :origin :viewer}]
|
[:& login-methods {:on-success-callback success-login :origin :viewer}]
|
||||||
[:div {:class (stl/css :links)}
|
[:div {:class (stl/css :links)}
|
||||||
[:div {:class (stl/css :link-entry :recovery-request)}
|
[:div {:class (stl/css :recovery-request)}
|
||||||
[:a {:on-click set-section
|
[:a {:on-click set-section
|
||||||
|
:class (stl/css :recovery-link)
|
||||||
:data-value "recovery-request"}
|
:data-value "recovery-request"}
|
||||||
(tr "auth.forgot-password")]]
|
(tr "auth.forgot-password")]]
|
||||||
[:div {:class (stl/css :link-entry :register)}
|
[:div {:class (stl/css :register)}
|
||||||
[:span (tr "auth.register") " "]
|
[:span {:class (stl/css :register-text)}
|
||||||
|
(tr "auth.register") " "]
|
||||||
[:a {:on-click set-section
|
[:a {:on-click set-section
|
||||||
|
:class (stl/css :register-link)
|
||||||
:data-value "register"}
|
:data-value "register"}
|
||||||
(tr "auth.register-submit")]]]]
|
(tr "auth.register-submit")]]]]
|
||||||
|
|
||||||
|
@ -98,7 +100,7 @@
|
||||||
[:div {:class (stl/css :form-container)}
|
[:div {:class (stl/css :form-container)}
|
||||||
[:& register-methods {:on-success-callback success-register}]
|
[:& register-methods {:on-success-callback success-register}]
|
||||||
[:div {:class (stl/css :links)}
|
[:div {:class (stl/css :links)}
|
||||||
[:div {:class (stl/css :link-entry :account)}
|
[:div {:class (stl/css :account)}
|
||||||
[:span (tr "auth.already-have-account") " "]
|
[:span (tr "auth.already-have-account") " "]
|
||||||
[:a {:on-click set-section
|
[:a {:on-click set-section
|
||||||
:data-value "login"}
|
:data-value "login"}
|
||||||
|
@ -109,7 +111,7 @@
|
||||||
[:& register-validate-form {:params {:token @register-token}
|
[:& register-validate-form {:params {:token @register-token}
|
||||||
:on-success-callback success-email-sent}]
|
:on-success-callback success-email-sent}]
|
||||||
[:div {:class (stl/css :links)}
|
[:div {:class (stl/css :links)}
|
||||||
[:div {:class (stl/css :link-entry :register)}
|
[:div {:class (stl/css :register)}
|
||||||
[:a {:on-click set-section
|
[:a {:on-click set-section
|
||||||
:data-value "register"}
|
:data-value "register"}
|
||||||
(tr "labels.go-back")]]]]
|
(tr "labels.go-back")]]]]
|
||||||
|
|
Loading…
Add table
Reference in a new issue