Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: component styles and sign up / onboarding dark mode #12581

Merged
merged 28 commits into from
Dec 6, 2023

Conversation

stabildev
Copy link
Contributor

Hi all, this PR fixes some minor issues I encountered when setting up Cal.com locally. Also added dark mode support to the onboarding.

What does this PR do?

  • Fix some styling issues (see below)
  • Add full dark mode support to the (new) sign up form and the whole onboarding process

1. Fix missing vertical divider with addOnLeading:

Before:
AddOnLeadingBefore

After (now congruent withaddOnSuffix:
AddOnLeadingAfter

2. Fix PasswordField border getting brighter (in dark mode) when focused but not hovered
This issue is related to 4438ca2 . Back then the PasswordField input was wrapped with a <div className="absolute"> and some custom selectors. This wrapping <div> is not needed anymore because the show/hide password eye icon is now added to the input via the addOnSuffix prop. Removing this wrapper resolves the issue.

Before:
PasswordBefore

After:
PasswordAfter

3. Fix corners in new sign up form

Before:
SignupCornersBefore

After:
SignupCornersAfter

4. Fix primary button color in dark mode
In most places this was already applied manually. This PR adds the dark mode styling to the component itself for design consistency.

Before:
PrimaryButtonBefore

After:
PrimaryButtonAfter

5. Enable dark mode for the (new) sign up form and the complete onboarding process

Sign Up Form:
SignupDarkMode

Getting Started:
GettingStarted1

GettingStarted2

GettingStarted4

GettingStarted5

6. Fix styling of Apple Calendar Setup

Before:
AppleBefore

After:
AppleAfter

After (Light mode):
AppleAfterLight

Requirement/Documentation

  • none

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Chore (refactoring code, technical debt, workflow improvements)

How should this be tested?

Visual check of the affected routes (in system dark mode), especially:

  • /signup
  • /getting-started/[[step]]
  • /apps/apple-calendar/setup

Mandatory Tasks

  • Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.

Checklist

Copy link

vercel bot commented Nov 29, 2023

Someone is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant
Copy link

CLAassistant commented Nov 29, 2023

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

github-actions bot commented Nov 29, 2023

Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link to collect XP and win prizes!

@stabildev stabildev changed the title Components and darkmode fix: component styles and sign up / onboarding dark mode Nov 29, 2023
Copy link
Contributor

github-actions bot commented Nov 29, 2023

📦 Next.js Bundle Analysis for @calcom/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

Sixty-eight Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load % of Budget (350 KB)
/apps 268.38 KB 431.59 KB 123.31% (🟡 +0.26%)
/apps/[slug] 286.5 KB 449.72 KB 128.49% (🟡 +0.26%)
/apps/[slug]/[...pages] 545.5 KB 708.72 KB 202.49% (🟡 +0.47%)
/apps/categories 246.23 KB 409.44 KB 116.98% (🟡 +0.27%)
/apps/categories/[category] 250.91 KB 414.13 KB 118.32% (🟡 +0.26%)
/apps/installed/[category] 270.46 KB 433.68 KB 123.91% (🟡 +0.26%)
/auth/login 118.45 KB 281.66 KB 80.48% (🟢 -0.18%)
/auth/setup 149.71 KB 312.92 KB 89.41% (🟢 -0.17%)
/availability 383.99 KB 547.2 KB 156.34% (🟡 +0.27%)
/availability/[schedule] 349.89 KB 513.11 KB 146.60% (🟡 +0.27%)
/availability/troubleshoot 271.59 KB 434.8 KB 124.23% (🟡 +0.26%)
/bookings/[status] 316.11 KB 479.33 KB 136.95% (🟡 +0.26%)
/enterprise 246.69 KB 409.9 KB 117.11% (🟡 +0.27%)
/event-types 542.86 KB 706.08 KB 201.74% (🟡 +0.45%)
/event-types/[type] 419.64 KB 582.85 KB 166.53% (🟡 +0.45%)
/getting-started/[[...step]] 402.57 KB 565.78 KB 161.65% (🟡 +0.43%)
/insights 472.41 KB 635.62 KB 181.61% (🟡 +0.26%)
/more 245.86 KB 409.07 KB 116.88% (🟡 +0.26%)
/org/[orgSlug] 227.62 KB 390.83 KB 111.67% (🟢 -0.18%)
/org/[orgSlug]/[user] 234.16 KB 397.37 KB 113.53% (🟢 -0.17%)
/org/[orgSlug]/[user]/embed 234.18 KB 397.39 KB 113.54% (🟢 -0.17%)
/org/[orgSlug]/embed 227.63 KB 390.85 KB 111.67% (🟢 -0.17%)
/org/[orgSlug]/team/[slug] 227.63 KB 390.84 KB 111.67% (🟢 -0.17%)
/settings/admin 252.51 KB 415.72 KB 118.78% (🟡 +0.26%)
/settings/admin/apps 265.74 KB 428.95 KB 122.56% (🟡 +0.26%)
/settings/admin/apps/[category] 265.73 KB 428.94 KB 122.55% (🟡 +0.27%)
/settings/admin/flags 256.27 KB 419.48 KB 119.85% (🟡 +0.26%)
/settings/admin/impersonation 252.78 KB 415.99 KB 118.85% (🟡 +0.27%)
/settings/admin/oAuth 264.52 KB 427.73 KB 122.21% (🟡 +0.26%)
/settings/admin/oAuth/oAuthView 91.75 KB 254.97 KB 72.85% (🟡 +0.19%)
/settings/admin/organizations 253.8 KB 417.02 KB 119.15% (🟡 +0.26%)
/settings/admin/users 254.73 KB 417.94 KB 119.41% (🟡 +0.26%)
/settings/admin/users/[id]/edit 354.63 KB 517.85 KB 147.96% (🟡 +0.26%)
/settings/admin/users/add 354.37 KB 517.58 KB 147.88% (🟡 +0.26%)
/settings/billing 252.72 KB 415.93 KB 118.84% (🟡 +0.26%)
/settings/developer/api-keys 257.13 KB 420.34 KB 120.10% (🟡 +0.26%)
/settings/developer/webhooks 257.05 KB 420.27 KB 120.08% (🟡 +0.26%)
/settings/developer/webhooks/[id] 258.43 KB 421.64 KB 120.47% (🟡 +0.26%)
/settings/developer/webhooks/new 258.49 KB 421.7 KB 120.49% (🟡 +0.26%)
/settings/my-account/appearance 276.15 KB 439.36 KB 125.53% (🟡 +0.26%)
/settings/my-account/calendars 264.36 KB 427.58 KB 122.16% (🟡 +0.27%)
/settings/my-account/conferencing 264.67 KB 427.88 KB 122.25% (🟡 +0.27%)
/settings/my-account/general 340.93 KB 504.14 KB 144.04% (🟡 +0.26%)
/settings/my-account/profile 389.87 KB 553.09 KB 158.02% (🟡 +0.27%)
/settings/organizations/appearance 265.12 KB 428.33 KB 122.38% (🟡 +0.26%)
/settings/organizations/billing 252.75 KB 415.96 KB 118.85% (🟡 +0.26%)
/settings/organizations/general 333.42 KB 496.63 KB 141.90% (🟡 +0.26%)
/settings/organizations/members 381.47 KB 544.68 KB 155.62% (🟡 +0.27%)
/settings/organizations/profile 386.95 KB 550.17 KB 157.19% (🟡 +0.26%)
/settings/organizations/teams/other 253.58 KB 416.8 KB 119.08% (🟡 +0.27%)
/settings/organizations/teams/other/[id]/appearance 265.21 KB 428.43 KB 122.41% (🟡 +0.26%)
/settings/organizations/teams/other/[id]/members 259.59 KB 422.8 KB 120.80% (🟡 +0.26%)
/settings/organizations/teams/other/[id]/profile 459.41 KB 622.62 KB 177.89% (🟡 +0.32%)
/settings/security/impersonation 257.81 KB 421.02 KB 120.29% (🟡 +0.27%)
/settings/security/password 266.63 KB 429.84 KB 122.81% (🟡 +0.27%)
/settings/security/sso 262.84 KB 426.05 KB 121.73% (🟡 +0.26%)
/settings/security/two-factor-auth 261.65 KB 424.87 KB 121.39% (🟡 +0.26%)
/settings/teams 252.25 KB 415.47 KB 118.71% (🟡 +0.26%)
/settings/teams/[id]/appearance 265.2 KB 428.41 KB 122.40% (🟡 +0.27%)
/settings/teams/[id]/billing 252.75 KB 415.97 KB 118.85% (🟡 +0.26%)
/settings/teams/[id]/members 378.55 KB 541.76 KB 154.79% (🟡 +0.26%)
/settings/teams/[id]/profile 460.23 KB 623.44 KB 178.13% (🟡 +0.32%)
/settings/teams/[id]/sso 263.36 KB 426.57 KB 121.88% (🟡 +0.26%)
/team/[slug] 227.58 KB 390.79 KB 111.66% (🟢 -0.18%)
/team/[slug]/embed 227.62 KB 390.84 KB 111.67% (🟢 -0.17%)
/teams 246.13 KB 409.34 KB 116.96% (🟡 +0.26%)
/workflows 284.29 KB 447.5 KB 127.86% (🟡 +0.26%)
/workflows/[workflow] 397.68 KB 560.89 KB 160.26% (🟡 +0.26%)
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.

Comment on lines 51 to 52
"bg-brand-default hover:bg-brand-emphasis focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset focus-visible:ring-brand-default text-brand disabled:bg-brand-subtle disabled:text-brand-subtle disabled:opacity-40 disabled:hover:bg-brand-subtle disabled:hover:text-brand-default disabled:hover:opacity-40 dark:bg-white dark:text-black",
secondary:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These values should be correct already - without the dark: prefix

If they were not working in a specific area of the app (onboarding) the variables may not have been set

Copy link
Member

@sean-brydon sean-brydon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow this is a great addition!

Dark mode looks awesome well done. I have one ask that we refrain from using dark: anywhere possible.

We have tokens defined in cal.com/apps/web/styles/globals.css

If they are not working on a specific page that is another issue. The rest of the app functions fine in darkmode.

Great PR thanks bud!

Edit: Looking at this more i think the issue you are seeing here is the cal brand colour is not set yet - due to that being a user defined thing in settings.

We will need to set them in classNames

Light Mode:
"--cal-brand": "#111827",
"--cal-brand-emphasis": "#101010",
"--cal-brand-text": "white",

Dark Mode:
--cal-brand: white;
--cal-brand-emphasis: #e1e1e1;
--cal-brand-text: black;

@@ -106,16 +105,8 @@ const OnboardingPage = () => {

return (
<div
className="dark:bg-brand dark:text-brand-contrast text-emphasis min-h-screen"
className="dark:bg-brand dark:text-brand-contrast text-emphasis min-h-screen [--cal-brand-emphasis:#101010] [--cal-brand-subtle:9CA3AF] [--cal-brand-text:#FFFFFF] [--cal-brand:#111827] dark:[--cal-brand-emphasis:#e1e1e1] dark:[--cal-brand-text:#000000] dark:[--cal-brand:white]"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stabildev - I pushed these changes to your branch to allow us to have the correct styling for both light and dark mode

(We only ever had the light mode vars - as thats all we supported)

@@ -355,7 +355,10 @@ export default function Signup({
router.push(GOOGLE_AUTH_URL);
}}>
<img
className={classNames("text-emphasis mr-2 h-5 w-5", premiumUsername && "opacity-50")}
className={classNames(
"text-emphasis mr-2 h-5 w-5 dark:invert",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets invert the google icon here too

Copy link

vercel bot commented Nov 29, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview Nov 29, 2023 10:42am

@stabildev
Copy link
Contributor Author

Wow this is a great addition!

Dark mode looks awesome well done.

Thanks!

I have one ask that we refrain from using dark: anywhere possible.

I copied that approach from /login.tsx (changed over there as well now).

Can confirm that everything looks as intended. With one exception:

image

IMO bg-transparent would make more sense on the secondary (outline) button:

image

@stabildev
Copy link
Contributor Author

Originally refactored the sign up page using AuthContainer like this

image

At the same time that 8dabbbd (signup refactor) happened

@sean-brydon
Copy link
Member

Wow this is a great addition!
Dark mode looks awesome well done.

Thanks!

I have one ask that we refrain from using dark: anywhere possible.

I copied that approach from /login.tsx (changed over there as well now).

Can confirm that everything looks as intended. With one exception:

image

IMO bg-transparent would make more sense on the secondary (outline) button:

image

Thanks for the feedback - lets stick with the designs that are in figma atm for the secondary button. I will discuss this with our designers to ensure this is the correct approach that we wish to take. For now i think leaving it as the bg-default is the best approach.

@sean-brydon
Copy link
Member

All looks good to me @stabildev - great first contribution! I will try and figure out why linter is failing after these calls 🙏

@stabildev
Copy link
Contributor Author

All looks good to me @stabildev - great first contribution! I will try and figure out why linter is failing after these calls 🙏

Thanks @sean-brydon . There seems to be a mismatch with prettier and eslint regarding tailwind class sorting (especially those [custom_selector_classes].

@sean-brydon
Copy link
Member

All looks good to me @stabildev - great first contribution! I will try and figure out why linter is failing after these calls 🙏

Thanks @sean-brydon . There seems to be a mismatch with prettier and eslint regarding tailwind class sorting (especially those [custom_selector_classes].

Yeah i know! never seen it before and can't get it to pass either :')

@PeerRich PeerRich added Medium priority Created by Linear-GitHub Sync ui area: UI, frontend, button, form, input labels Dec 1, 2023
sean-brydon
sean-brydon previously approved these changes Dec 4, 2023
Copy link
Member

@sean-brydon sean-brydon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sean-brydon sean-brydon enabled auto-merge (squash) December 6, 2023 20:47
Copy link
Member

@sean-brydon sean-brydon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sean-brydon sean-brydon merged commit 55d44ce into calcom:main Dec 6, 2023
32 of 40 checks passed
hbjORbj pushed a commit to codemod-com/cal.com-demo that referenced this pull request Dec 21, 2023
* fix divider border for addOnLeading

* fix primary button in dark mode and password input border

* signup dark mode and corner fix

* onboarding dark mode

* fix css var issue and use inline vars for light and dark mode

* Invert google icon on dark mode

* Fix typo

* fix eslint errors with yarn lint:fix

* use css vars on login page as well

* running lint manually

* Fix subtle

* Fix

* Fix

* linting

* linting

* chore: restore main yarn.lock

* fix: lint error

---------

Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: Sean Brydon <sean@brydon.io>
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
Co-authored-by: sean-brydon <sean@cal.com>
Co-authored-by: Alex van Andel <me@alexvanandel.com>
@stabildev
Copy link
Contributor Author

All looks good to me @stabildev - great first contribution! I will try and figure out why linter is failing after these calls 🙏

Thanks @sean-brydon . There seems to be a mismatch with prettier and eslint regarding tailwind class sorting (especially those [custom_selector_classes].

Yeah i know! never seen it before and can't get it to pass either :')

@sean-brydon I have the same issue in another project now: custom tailwind classes get sorted differently in prettier vs in eslint. Did you manage to fix this issue?

haranrk pushed a commit to haranrk/cal.com that referenced this pull request Jan 4, 2024
* fix divider border for addOnLeading

* fix primary button in dark mode and password input border

* signup dark mode and corner fix

* onboarding dark mode

* fix css var issue and use inline vars for light and dark mode

* Invert google icon on dark mode

* Fix typo

* fix eslint errors with yarn lint:fix

* use css vars on login page as well

* running lint manually

* Fix subtle

* Fix

* Fix

* linting

* linting

* chore: restore main yarn.lock

* fix: lint error

---------

Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: Sean Brydon <sean@brydon.io>
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
Co-authored-by: sean-brydon <sean@cal.com>
Co-authored-by: Alex van Andel <me@alexvanandel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Medium priority Created by Linear-GitHub Sync ui area: UI, frontend, button, form, input
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants