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

[DEV-9859] Improve mobile data table font sizes #1713

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Icon from '../../ui/Icon'
import { fontSizes } from '../../../helpers/cove/fontSettings'

const ExpandCollapse = ({ expanded, setExpanded, tableTitle, fontSize, viewport }) => {
const titleFontSize = ['sm', 'xs', 'xxs'].includes(viewport) ? '13px' : `${fontSizes[fontSize]}px`
const titleFontSize = ['xs', 'xxs'].includes(viewport) ? '13px' : `${fontSizes[fontSize]}px`
return (
<div
style={{ fontSize: titleFontSize }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,18 @@
top: 0.5rem;
}
}

@media (max-width: 576px) {
.sort-icon {
:is(svg) {
width: 0.9rem;
height: 0.9rem;
}
.up {
bottom: 0.3rem;
}
.down {
top: 0.3rem;
}
}
}
2 changes: 1 addition & 1 deletion packages/core/components/Table/components/Row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const Row: FC<RowProps> = props => {
const whiteSpace = wrapColumns ? 'unset' : 'nowrap'
const minWidth = cellMinWidth + 'px'
const fontSizes = { small: 16, medium: 18, large: 20 }
const cellFontSize = ['sm', 'xs', 'xxs'].includes(viewport) ? '11px' : `${fontSizes[fontSize]}px`
const cellFontSize = ['xs', 'xxs'].includes(viewport) ? '12px' : `${fontSizes[fontSize]}px`

return (
<tr>
Expand Down
4 changes: 2 additions & 2 deletions packages/core/styles/_global-variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ $colors: (
--font-size: 17px;
}

@media (max-width: 768px) {
@media (max-width: 576px) {
:root {
--font-size: 0.9em;
--font-size: 13px;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,16 @@ type CollapsableVizRow = {
groupName: string
currentViewport: string
}
const CollapsibleVisualizationRow: React.FC<CollapsableVizRow> = ({ allExpanded, fontSize, groupName, currentViewport, children }) => {
const CollapsibleVisualizationRow: React.FC<CollapsableVizRow> = ({
allExpanded,
fontSize,
groupName,
currentViewport,
children
}) => {
const [isExpanded, setIsExpanded] = useState(allExpanded)
const fontSizes = { small: 16, medium: 18, large: 20 }
const titleFontSize = ['sm', 'xs', 'xxs'].includes(currentViewport) ? '13px' : `${fontSizes[fontSize]}px`
const titleFontSize = ['xs', 'xxs'].includes(currentViewport) ? '13px' : `${fontSizes[fontSize]}px`

useEffect(() => {
setIsExpanded(allExpanded)
Expand Down
Loading