Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
Feat; add new breakpoint between tablet and desktop called laptop (lp)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbracegirdle committed Jun 19, 2024
1 parent fc18510 commit a27c307
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@govconnex/ui",
"version": "0.0.186",
"version": "0.0.188",
"description": "GovConnex UI - React Component Library",
"scripts": {
"build:tokens": "./tokens-build.sh",
Expand Down
1 change: 1 addition & 0 deletions src/components/Box/Box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export interface ExtendedBoxProps extends BoxProps {
// breakpoints
sm?: customStyles;
md?: customStyles;
lp?: customStyles;
lg?: customStyles;

direction?: "row" | "column" | "row-reverse" | "column-reverse";
Expand Down
12 changes: 7 additions & 5 deletions src/core/styleFunctions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,16 @@ type ShorthandCSS = {
type breakpoints = {
sm?: CSS.Properties | ShorthandCSS;
md?: CSS.Properties | ShorthandCSS;
lp?: CSS.Properties | ShorthandCSS;
lg?: CSS.Properties | ShorthandCSS;
};

type keysTypes = "sm" | "md" | "lg";
type keysTypes = "sm" | "md" | "lp" | "lg";

const values: {sm: number; md: number; lg: number} = {
sm: 0, // tablet
md: 600, // small laptop
const values: {sm: number; md: number; lp: number; lg: number} = {
sm: 0, // mobile
md: 600, // tablet
lp: 960, // small laptop
lg: 1360, // desktop 1360
};

Expand Down Expand Up @@ -106,7 +108,7 @@ const numberToSpacingMap = {
export type customStyles = CSS.Properties | breakpoints | ShorthandCSS;

const defaultBreakpoints = {
keys: ["sm", "md", "lg"],
keys: ["sm", "md", "lp", "lg"],
up: (key: keysTypes) => `@media (min-width:${values[key]}px)`,
};

Expand Down

0 comments on commit a27c307

Please sign in to comment.