feat(client): one control height of 32px
Buttons, inputs, selects, pickers, toggles and tabs all declared 34 while IconButton and the PageHeader action sat at 32, so anything mixing them in a row was 2px out of alignment. Everything now reads CONTROL_HEIGHT (32) from constants, so the number lives in one place instead of nine. Two content-box fixes were needed to make 32 safe, both measured in the browser rather than assumed: - MUI's button line-height is 1.75 - 22.75px at our 13px base - which with 6px padding needs 34.75px. It was already over its own box at 34 and would have clipped at 32. Now 1.2, which leaves headroom for the taller scripts we ship (ar, th, vi, ja, zh). - MUI pads the inner input 8.5px top and bottom, so an input's content needed 35.7px inside a 32px shell and was being cut off by overflow:hidden. Padding is zeroed in the theme for both the input and the Select's div, which centres instead. Verified in the DOM: button, select and input all render at exactly 32 with scrollHeight equal to height, so nothing is clipped. Claude-Session: https://claude.ai/code/session_01AbYLvwpEaZFXktHVcqrFRd
This commit is contained in:
1 parent
dbe0e2f4e3
commit
de8eb53dd4
12 files changed
+49
-13
No files matched your search
@@ -6,6 +6,7 @@ import { Link as RouterLink } from "react-router-dom";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useTheme } from "@mui/material/styles";
|
||||
import { ChevronLeft, HelpCircle, FileText, Code } from "lucide-react";
|
||||
import { CONTROL_HEIGHT } from "@/Utils/Theme/constants";
|
||||
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
@@ -145,7 +146,7 @@ export const PageHeader = ({
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
width: 36,
|
||||
height: 32,
|
||||
height: CONTROL_HEIGHT,
|
||||
color: theme.palette.text.secondary,
|
||||
borderRight:
|
||||
idx < linkItems.length - 1
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Box, Stack, useTheme } from "@mui/material";
|
||||
import { CONTROL_HEIGHT } from "@/Utils/Theme/constants";
|
||||
|
||||
interface SkeletonCardProps {
|
||||
width?: number | string | { xs?: number | string; md?: number | string };
|
||||
@@ -44,7 +45,7 @@ export const SkeletonCard = ({
|
||||
|
||||
const blockStyle = {
|
||||
width: 55,
|
||||
height: 34,
|
||||
height: CONTROL_HEIGHT,
|
||||
borderRadius: theme.shape.borderRadius,
|
||||
background: theme.palette.secondary.main,
|
||||
border: `1px solid ${theme.palette.divider}`,
|
||||
|
||||
@@ -2,6 +2,7 @@ import MuiTabs from "@mui/material/Tabs";
|
||||
import type { TabsProps } from "@mui/material/Tabs";
|
||||
import { useTheme } from "@mui/material/styles";
|
||||
import { typographyLevels } from "@/Utils/Theme/Palette";
|
||||
import { CONTROL_HEIGHT } from "@/Utils/Theme/constants";
|
||||
interface CustomTabsProps extends TabsProps {}
|
||||
|
||||
export const Tabs = (props: CustomTabsProps) => {
|
||||
@@ -9,7 +10,7 @@ export const Tabs = (props: CustomTabsProps) => {
|
||||
return (
|
||||
<MuiTabs
|
||||
sx={{
|
||||
minHeight: 34,
|
||||
minHeight: CONTROL_HEIGHT,
|
||||
borderBottom: `1px solid ${theme.palette.divider}`,
|
||||
"& .MuiTabs-indicator": {
|
||||
backgroundColor: theme.palette.primary.main,
|
||||
@@ -41,7 +42,7 @@ export const Tab = (props: CustomTabProps) => {
|
||||
textTransform: "none",
|
||||
fontSize: typographyLevels.m,
|
||||
fontWeight: 500,
|
||||
minHeight: 34,
|
||||
minHeight: CONTROL_HEIGHT,
|
||||
padding: theme.spacing(1, 0),
|
||||
paddingBottom: 0,
|
||||
minWidth: "auto",
|
||||
|
||||
Reference in new issue
Block a user