From 456cfdfbb0ba84858e59f8ae092a4539b368bdb6 Mon Sep 17 00:00:00 2001 From: thislight Date: Tue, 5 Nov 2024 16:07:10 +0800 Subject: [PATCH 1/3] typography: remove module css --- src/material/Button.tsx | 14 +++++++++----- src/material/material.module.css | 1 - .../{typography.module.css => typography.css} | 3 +-- src/material/typography.tsx | 7 ++----- 4 files changed, 12 insertions(+), 13 deletions(-) rename src/material/{typography.module.css => typography.css} (95%) diff --git a/src/material/Button.tsx b/src/material/Button.tsx index 1e08e41..524e378 100644 --- a/src/material/Button.tsx +++ b/src/material/Button.tsx @@ -1,5 +1,6 @@ import { Component, JSX, splitProps } from "solid-js"; import materialStyles from "./material.module.css"; +import "./typography.css"; /** * Material-styled button. @@ -10,12 +11,15 @@ const Button: Component> = ( props, ) => { const [managed, passthough] = splitProps(props, ["class", "type"]); - const classes = () => - managed.class - ? [materialStyles.button, managed.class].join(" ") - : materialStyles.button; const type = () => managed.type ?? "button"; - return ; + + return ( + + ); }; export default Button; diff --git a/src/material/material.module.css b/src/material/material.module.css index 3443756..18d8fc8 100644 --- a/src/material/material.module.css +++ b/src/material/material.module.css @@ -10,7 +10,6 @@ } .button { - composes: buttonText from "./typography.module.css"; composes: touchTarget; border: none; diff --git a/src/material/typography.module.css b/src/material/typography.css similarity index 95% rename from src/material/typography.module.css rename to src/material/typography.css index 4606687..2e1c9af 100644 --- a/src/material/typography.module.css +++ b/src/material/typography.css @@ -29,12 +29,11 @@ font-size: var(--subheading-size); } -.body1 { +.body1, .body2 { font-size: var(--body-size); } .body2 { - composes: body1; font-weight: var(--body2-weight); } diff --git a/src/material/typography.tsx b/src/material/typography.tsx index 2ea0fd3..40f690d 100644 --- a/src/material/typography.tsx +++ b/src/material/typography.tsx @@ -1,7 +1,6 @@ import { JSX, ParentComponent, splitProps, type Ref } from "solid-js"; import { Dynamic } from "solid-js/web"; -import typography from "./typography.module.css"; -import { mergeClass } from "../utils"; +import "./typography.css"; type AnyElement = keyof JSX.IntrinsicElements | ParentComponent; @@ -40,13 +39,11 @@ export function Typography( "class", "typography", ]); - const classes = () => - mergeClass(managed.class, typography[managed.typography]); return ( ); From bda41f092344dabb75eead969519b034c1081f72 Mon Sep 17 00:00:00 2001 From: thislight Date: Tue, 5 Nov 2024 16:19:55 +0800 Subject: [PATCH 2/3] Profile: supports bot mark --- src/profiles/Profile.css | 10 ++++++++++ src/profiles/Profile.tsx | 24 ++++++++++++++++-------- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/src/profiles/Profile.css b/src/profiles/Profile.css index 31e5c78..caced73 100644 --- a/src/profiles/Profile.css +++ b/src/profiles/Profile.css @@ -38,6 +38,16 @@ flex-flow: column nowrap; } + .bot-mark { + font-size: 1.2em; + } + + .display-name { + display: flex; + align-items: center; + gap: 4px; + } + table.acct-fields { word-break: break-all; diff --git a/src/profiles/Profile.tsx b/src/profiles/Profile.tsx index 4e8a930..3d1d734 100644 --- a/src/profiles/Profile.tsx +++ b/src/profiles/Profile.tsx @@ -38,10 +38,12 @@ import { PlaylistAdd, Send, Share, + SmartToy, + SmartToySharp, Translate, Verified, } from "@suid/icons-material"; -import { Title } from "../material/typography"; +import { Body2, Title } from "../material/typography"; import { useNavigate, useParams } from "@solidjs/router"; import { useSessionForAcctStr } from "../masto/clients"; import { resolveCustomEmoji } from "../masto/toot"; @@ -400,15 +402,21 @@ const Profile: Component = () => { }} >
- - createRenderEffect(() => (e.innerHTML = displayName())) - } - aria-label="Display name" - > +
+ + + + + createRenderEffect(() => (e.innerHTML = displayName())) + } + aria-label="Display name" + > +
{fullUsername()}
-
+
Date: Tue, 5 Nov 2024 16:20:13 +0800 Subject: [PATCH 3/3] RegularToot: supports bot mark --- src/timelines/RegularToot.tsx | 28 +++++++++++++++++----------- src/timelines/toot.module.css | 14 +++++++++----- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/src/timelines/RegularToot.tsx b/src/timelines/RegularToot.tsx index 5984180..35809df 100644 --- a/src/timelines/RegularToot.tsx +++ b/src/timelines/RegularToot.tsx @@ -20,6 +20,7 @@ import { StarOutline, Bookmark, Share, + SmartToySharp, } from "@suid/icons-material"; import { useTimeSource } from "../platform/timesrc.js"; import { resolveCustomEmoji } from "../masto/toot.js"; @@ -151,17 +152,22 @@ function TootAuthorGroup(
- { - createRenderEffect(() => { - e.innerHTML = resolveCustomEmoji( - toot().account.displayName, - toot().account.emojis, - ); - }); - }} - /> +
+ + + + { + createRenderEffect(() => { + e.innerHTML = resolveCustomEmoji( + toot().account.displayName, + toot().account.emojis, + ); + }); + }} + /> +