From f5dfd52f6efece2f4cad227044ecf4dd66301bbc Mon Sep 17 00:00:00 2001 From: crupest Date: Sat, 26 Aug 2023 21:36:58 +0800 Subject: ... --- FrontEnd/src/components/index.css | 100 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 FrontEnd/src/components/index.css (limited to 'FrontEnd/src/components/index.css') diff --git a/FrontEnd/src/components/index.css b/FrontEnd/src/components/index.css new file mode 100644 index 00000000..a8f5e9a5 --- /dev/null +++ b/FrontEnd/src/components/index.css @@ -0,0 +1,100 @@ +@import "./theme.css"; + +* { + box-sizing: border-box; + margin-inline: 0; + margin-block: 0; +} + +body { + font-family: var(--cru-default-font-family); + background: var(--cru-body-background-color); + color: var(--cru-text-primary-color); + line-height: 1.2; +} + +.cru-page { + padding: var(--cru-page-padding); +} + +.cru-page-no-top-padding { + padding-top: 0; +} + +.cru-text-center { + text-align: center; +} + +.cru-text-end { + text-align: end; +} + +.cru-float-left { + float: left; +} + +.cru-float-right { + float: right; +} + +.cru-align-text-bottom { + vertical-align: text-bottom; +} + +.cru-align-middle { + vertical-align: middle; +} + +.cru-clearfix::after { + clear: both; +} + +.cru-fill-parent { + width: 100%; + height: 100%; +} + +.cru-avatar { + width: 60px; + height: 60px; +} + +.cru-avatar.large { + width: 100px; + height: 100px; +} + +.cru-avatar.small { + width: 40px; + height: 40px; +} + +.cru-round { + border-radius: 50%; +} + +.cru-tab-pages-action-area { + display: flex; + align-items: center; +} + +.alert-container { + position: fixed; + z-index: 1070; +} + +@media (min-width: 576px) { + .alert-container { + bottom: 0; + right: 0; + } +} + +@media (max-width: 575.98px) { + .alert-container { + bottom: 0; + right: 0; + left: 0; + text-align: center; + } +} \ No newline at end of file -- cgit v1.2.3 From 9c69024cf5961c3c71fb58e4237f09a513d195b1 Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 31 Aug 2023 00:30:35 +0800 Subject: Minor buttons --- FrontEnd/src/components/button/Button.tsx | 4 +-- FrontEnd/src/components/button/ButtonRowV2.tsx | 14 ++++---- FrontEnd/src/components/button/FlatButton.tsx | 4 +-- FrontEnd/src/components/button/IconButton.tsx | 4 +-- FrontEnd/src/components/button/LoadingButton.tsx | 4 +-- FrontEnd/src/components/common.ts | 2 ++ FrontEnd/src/components/dialog/FullPageDialog.tsx | 4 +-- FrontEnd/src/components/dialog/OperationDialog.tsx | 39 +++++++++------------- FrontEnd/src/components/index.css | 2 +- FrontEnd/src/components/theme.css | 23 ++++++++++--- FrontEnd/src/pages/setting/index.css | 4 +-- FrontEnd/src/pages/timeline/TimelineCard.css | 4 +-- .../src/pages/timeline/TimelinePostCreateView.css | 4 +-- 13 files changed, 62 insertions(+), 50 deletions(-) (limited to 'FrontEnd/src/components/index.css') diff --git a/FrontEnd/src/components/button/Button.tsx b/FrontEnd/src/components/button/Button.tsx index 6c38e130..30ea8c11 100644 --- a/FrontEnd/src/components/button/Button.tsx +++ b/FrontEnd/src/components/button/Button.tsx @@ -1,12 +1,12 @@ import { ComponentPropsWithoutRef, Ref } from "react"; import classNames from "classnames"; -import { Text, useC, ThemeColor } from "../common"; +import { Text, useC, ClickableColor } from "../common"; import "./Button.css"; interface ButtonProps extends ComponentPropsWithoutRef<"button"> { - color?: ThemeColor; + color?: ClickableColor; text?: Text; outline?: boolean; buttonRef?: Ref | null; diff --git a/FrontEnd/src/components/button/ButtonRowV2.tsx b/FrontEnd/src/components/button/ButtonRowV2.tsx index 5129e7f1..a54425cc 100644 --- a/FrontEnd/src/components/button/ButtonRowV2.tsx +++ b/FrontEnd/src/components/button/ButtonRowV2.tsx @@ -1,7 +1,7 @@ import { ComponentPropsWithoutRef, Ref } from "react"; import classNames from "classnames"; -import { Text, ThemeColor } from "../common"; +import { Text, ClickableColor } from "../common"; import Button from "./Button"; import FlatButton from "./FlatButton"; @@ -10,10 +10,12 @@ import LoadingButton from "./LoadingButton"; import "./ButtonRow.css"; +type ButtonAction = "major" | "minor"; + interface ButtonRowV2ButtonBase { key: string | number; - action?: "primary" | "secondary"; - color?: ThemeColor; + action?: ButtonAction; + color?: ClickableColor; disabled?: boolean; onClick?: () => void; } @@ -76,9 +78,9 @@ export default function ButtonRowV2({ {buttons.map((button) => { const { key, action, color, disabled, onClick } = button; - const realAction = action ?? "primary"; + const realAction: ButtonAction = action ?? "minor"; const realColor = - color ?? (realAction === "primary" ? "primary" : "secondary"); + color ?? (realAction === "major" ? "primary" : "minor"); const commonProps = { key, color: realColor, disabled, onClick }; const newClassName = classNames( @@ -95,7 +97,7 @@ export default function ButtonRowV2({