From 41ffdff41332da35f982e85e509e82b9b265ab69 Mon Sep 17 00:00:00 2001 From: Matthew Lipski Date: Thu, 7 Mar 2024 20:14:54 +0100 Subject: [PATCH 1/3] Fixed home page mobile styles --- docs/components/pages/landing/gradients.css | 3 +++ docs/components/pages/landing/hero/Demo.tsx | 2 +- docs/components/pages/landing/hero/Text.tsx | 7 ++++--- docs/components/pages/landing/shared/Headings.tsx | 13 +++++++++++-- docs/components/pages/landing/styles.css | 4 ++++ 5 files changed, 23 insertions(+), 6 deletions(-) diff --git a/docs/components/pages/landing/gradients.css b/docs/components/pages/landing/gradients.css index 625df0aea2..ee91b37a53 100644 --- a/docs/components/pages/landing/gradients.css +++ b/docs/components/pages/landing/gradients.css @@ -13,6 +13,9 @@ section { .editor-glow { --glow-opacity: 0.4; + @media screen and (max-width: 640px) { + --glow-opacity: 0.25; + } background: conic-gradient( from 33deg at 50% 50%, hsla(var(--glow-blue), var(--glow-opacity)), diff --git a/docs/components/pages/landing/hero/Demo.tsx b/docs/components/pages/landing/hero/Demo.tsx index afe3870527..d16d3ef809 100644 --- a/docs/components/pages/landing/hero/Demo.tsx +++ b/docs/components/pages/landing/hero/Demo.tsx @@ -31,7 +31,7 @@ const DemoEditor = dynamic( export function Demo(props: { theme?: "light" | "dark" }) { return ( -
+
diff --git a/docs/components/pages/landing/hero/Text.tsx b/docs/components/pages/landing/hero/Text.tsx index 81e044f019..28885dd8de 100644 --- a/docs/components/pages/landing/hero/Text.tsx +++ b/docs/components/pages/landing/hero/Text.tsx @@ -6,15 +6,16 @@ import { CTAButton } from "@/components/pages/landing/shared/CTAButton"; export function Text() { return ( -
- +
+
+ The open source
Block-Based
rich text editor
- + A beautiful text editor that just works. Easily add an editor to your app that users will love. Customize it with your own functionality like custom blocks or AI tooling. diff --git a/docs/components/pages/landing/shared/Headings.tsx b/docs/components/pages/landing/shared/Headings.tsx index ea6f90ed05..f03d744196 100644 --- a/docs/components/pages/landing/shared/Headings.tsx +++ b/docs/components/pages/landing/shared/Headings.tsx @@ -48,10 +48,19 @@ export function SectionSubHeader({ children }: { children: React.ReactNode }) { ); } -export function SectionSubtext({ children }: { children: React.ReactNode }) { +export function SectionSubtext({ + children, + className, +}: { + children: React.ReactNode; + className?: string; +}) { return (

+ className={cn( + "font-space-grotesk text-lg leading-snug text-[#00000080] dark:text-[#FFFFFFB2] md:text-xl", + className, + )}> {children}

); diff --git a/docs/components/pages/landing/styles.css b/docs/components/pages/landing/styles.css index d45952326f..e7b2f3ffaa 100644 --- a/docs/components/pages/landing/styles.css +++ b/docs/components/pages/landing/styles.css @@ -8,6 +8,10 @@ } .nextra-nav-container { + z-index: 40; +} + +.nextra-sidebar-container { z-index: 30; } From 69266feff00138172b8fec31e5e8515e78d6c4d1 Mon Sep 17 00:00:00 2001 From: Matthew Lipski Date: Thu, 7 Mar 2024 20:17:53 +0100 Subject: [PATCH 2/3] Fixed example import --- examples/01-basic/04-selection-blocks/App.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/01-basic/04-selection-blocks/App.tsx b/examples/01-basic/04-selection-blocks/App.tsx index 22f0aaf620..5649a37878 100644 --- a/examples/01-basic/04-selection-blocks/App.tsx +++ b/examples/01-basic/04-selection-blocks/App.tsx @@ -1,6 +1,7 @@ import { Block } from "@blocknote/core"; +import "@blocknote/core/fonts/inter.css"; import { BlockNoteView, useCreateBlockNote } from "@blocknote/react"; -import "../../../packages/react/dist/style.css"; +import "@blocknote/react/style.css"; import { useState } from "react"; import "./styles.css"; From c8ad08f2c07fe0d6a50f70f4f2de350666003092 Mon Sep 17 00:00:00 2001 From: Matthew Lipski Date: Fri, 8 Mar 2024 17:24:40 +0100 Subject: [PATCH 3/3] Changed how mobile is detected --- docs/components/pages/landing/gradients.css | 15 ++++++++++++--- docs/components/pages/landing/hero/Demo.tsx | 4 ++-- docs/components/pages/landing/hero/DemoEditor.tsx | 2 -- docs/components/pages/landing/hero/Hero.tsx | 2 ++ docs/components/pages/landing/hero/Text.tsx | 2 +- docs/components/pages/landing/hero/styles.css | 12 +++++++++--- 6 files changed, 26 insertions(+), 11 deletions(-) diff --git a/docs/components/pages/landing/gradients.css b/docs/components/pages/landing/gradients.css index ee91b37a53..3effab24fb 100644 --- a/docs/components/pages/landing/gradients.css +++ b/docs/components/pages/landing/gradients.css @@ -11,11 +11,20 @@ section { --bg-color: #000000; } -.editor-glow { +.demo-glow { --glow-opacity: 0.4; - @media screen and (max-width: 640px) { - --glow-opacity: 0.25; + display: block; +} + +.text-glow { + --glow-opacity: 0.2; + display: none; + @media only screen and (hover: none) and (pointer: coarse) { + display: block; /* disable on mobile */ } +} + +.hero-glow { background: conic-gradient( from 33deg at 50% 50%, hsla(var(--glow-blue), var(--glow-opacity)), diff --git a/docs/components/pages/landing/hero/Demo.tsx b/docs/components/pages/landing/hero/Demo.tsx index d16d3ef809..cb5b64b703 100644 --- a/docs/components/pages/landing/hero/Demo.tsx +++ b/docs/components/pages/landing/hero/Demo.tsx @@ -31,8 +31,8 @@ const DemoEditor = dynamic( export function Demo(props: { theme?: "light" | "dark" }) { return ( -
-
+
+
diff --git a/docs/components/pages/landing/hero/DemoEditor.tsx b/docs/components/pages/landing/hero/DemoEditor.tsx index ab9dffcd36..b57d50203f 100644 --- a/docs/components/pages/landing/hero/DemoEditor.tsx +++ b/docs/components/pages/landing/hero/DemoEditor.tsx @@ -6,8 +6,6 @@ import { useCallback, useMemo, useState } from "react"; import YPartyKitProvider from "y-partykit/provider"; import * as Y from "yjs"; -import "./styles.css"; - const colors = [ "#958DF1", "#F98181", diff --git a/docs/components/pages/landing/hero/Hero.tsx b/docs/components/pages/landing/hero/Hero.tsx index fe47d374c3..3ffce4b0dc 100644 --- a/docs/components/pages/landing/hero/Hero.tsx +++ b/docs/components/pages/landing/hero/Hero.tsx @@ -4,6 +4,8 @@ import { Text } from "@/components/pages/landing/hero/Text"; import { Demo } from "@/components/pages/landing/hero/Demo"; import { FadeIn } from "@/components/pages/landing/shared/FadeIn"; +import "./styles.css"; + export function Hero() { const { theme } = useTheme(); diff --git a/docs/components/pages/landing/hero/Text.tsx b/docs/components/pages/landing/hero/Text.tsx index 28885dd8de..55b27b5c98 100644 --- a/docs/components/pages/landing/hero/Text.tsx +++ b/docs/components/pages/landing/hero/Text.tsx @@ -7,7 +7,7 @@ import { CTAButton } from "@/components/pages/landing/shared/CTAButton"; export function Text() { return (
-
+
The open source
diff --git a/docs/components/pages/landing/hero/styles.css b/docs/components/pages/landing/hero/styles.css index 73e6cc90f0..d10bee2770 100644 --- a/docs/components/pages/landing/hero/styles.css +++ b/docs/components/pages/landing/hero/styles.css @@ -1,8 +1,14 @@ -.hero .bn-container, .hero .bn-editor { +.hero-demo { + @media only screen and (hover: none) and (pointer: coarse) { + display: none; /* disable on mobile */ + } +} + +.hero-demo .bn-container, .hero .bn-editor { height: 100% } -.hero .bn-editor { +.hero-demo .bn-editor { overflow: auto; min-height: 100%; /* Removes focus outline */ @@ -10,7 +16,7 @@ padding-block: 1rem } -.hero a { +.hero-demo a { color: revert; text-decoration: revert; } \ No newline at end of file