Skip to content

Commit

Permalink
Remove typeSize (#770)
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysztofzuraw authored Mar 15, 2024
1 parent 42fac2b commit fa11d14
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 22 deletions.
5 changes: 5 additions & 0 deletions .changeset/early-elephants-watch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@saleor/macaw-ui": minor
---

Removed `typeSize` from `Box` and `sprinkles`. You should use `fontSize`, `letterSpacing` & `lineHeight` directly instead.
12 changes: 9 additions & 3 deletions src/components/BaseInput/BaseInput.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,19 @@ export const spanRecipe = recipe({
variants: {
size: {
small: sprinkles({
typeSize: 1,
fontSize: 1,
letterSpacing: 1,
lineHeight: 1,
}),
medium: sprinkles({
typeSize: 2,
fontSize: 2,
letterSpacing: 2,
lineHeight: 2,
}),
large: sprinkles({
typeSize: 3,
fontSize: 3,
letterSpacing: 3,
lineHeight: 3,
}),
},
disabled: {
Expand Down
24 changes: 18 additions & 6 deletions src/components/Button/Button.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ export const button = recipe({
width: 6,
borderRadius: 2,
padding: 0.5,
typeSize: 1,
fontSize: 1,
lineHeight: 1,
letterSpacing: 1,
gap: 1,
}),
},
Expand All @@ -131,7 +133,9 @@ export const button = recipe({
width: 8,
borderRadius: 3,
padding: 1,
typeSize: 2,
fontSize: 2,
lineHeight: 2,
letterSpacing: 2,
gap: 1,
}),
},
Expand All @@ -145,7 +149,9 @@ export const button = recipe({
width: 10,
borderRadius: 3,
padding: 2,
typeSize: 3,
fontSize: 3,
lineHeight: 3,
letterSpacing: 3,
gap: 2,
}),
},
Expand All @@ -159,7 +165,9 @@ export const button = recipe({
borderRadius: 2,
paddingX: 2,
paddingY: 0,
typeSize: 1,
fontSize: 1,
lineHeight: 1,
letterSpacing: 1,
gap: 1,
}),
},
Expand All @@ -173,7 +181,9 @@ export const button = recipe({
borderRadius: 3,
paddingX: 3,
paddingY: 1,
typeSize: 2,
fontSize: 2,
lineHeight: 2,
letterSpacing: 2,
gap: 1,
}),
},
Expand All @@ -187,7 +197,9 @@ export const button = recipe({
borderRadius: 3,
paddingX: 4,
paddingY: 2,
typeSize: 3,
fontSize: 3,
lineHeight: 2,
letterSpacing: 2,
gap: 2,
}),
},
Expand Down
13 changes: 9 additions & 4 deletions src/components/DropdownButton/DropdownButton.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,20 @@ export const dropdownButton = recipe({
borderRadius: 2,
paddingX: 2,
paddingY: 1,
typeSize: 1,
fontWeight: "medium",
fontSize: 1,
lineHeight: 2,
letterSpacing: 1,
fontWeight: "medium",
gap: 3,
}),
medium: sprinkles({
height: 8,
borderRadius: 3,
paddingX: 2,
paddingY: 1.5,
typeSize: 2,
fontSize: 2,
lineHeight: 2,
letterSpacing: 2,
fontWeight: "medium",
gap: 1,
}),
Expand All @@ -72,7 +75,9 @@ export const dropdownButton = recipe({
borderRadius: 3,
paddingX: 3,
paddingY: 2,
typeSize: 3,
fontSize: 3,
lineHeight: 3,
letterSpacing: 3,
fontWeight: "medium",
gap: 2,
}),
Expand Down
12 changes: 9 additions & 3 deletions src/components/Multiselect/Common/Multiselect.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,19 @@ export const multiselectInputRecipe = recipe({
variants: {
size: {
small: sprinkles({
typeSize: 1,
fontSize: 1,
lineHeight: 1,
letterSpacing: 1,
}),
medium: sprinkles({
typeSize: 2,
fontSize: 2,
lineHeight: 2,
letterSpacing: 2,
}),
large: sprinkles({
typeSize: 2,
fontSize: 2,
lineHeight: 2,
letterSpacing: 2,
}),
},
error: {
Expand Down
12 changes: 9 additions & 3 deletions src/components/RadioGroup/Group.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,19 @@ export const groupLabelRecipe = recipe({
variants: {
size: {
small: sprinkles({
typeSize: 1,
fontSize: 1,
letterSpacing: 1,
lineHeight: 1,
}),
medium: sprinkles({
typeSize: 2,
fontSize: 2,
letterSpacing: 2,
lineHeight: 2,
}),
large: sprinkles({
typeSize: 3,
fontSize: 3,
letterSpacing: 3,
lineHeight: 3,
}),
},
disabled: {
Expand Down
4 changes: 3 additions & 1 deletion src/components/Text/Text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ export const Text = forwardRef<HTMLSpanElement, TextProps>(
ref={ref}
margin={0}
data-macaw-ui-component="Text"
typeSize={size}
fontSize={size}
letterSpacing={size}
lineHeight={size}
fontWeight={fontWeight}
{...rest}
>
Expand Down
4 changes: 3 additions & 1 deletion src/components/Tooltip/Tooltip.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ export const content = sprinkles({
backgroundColor: "default1",
padding: 2,
borderRadius: 3,
typeSize: 1,
fontSize: 1,
lineHeight: 1,
letterSpacing: 1,
color: "default1",
boxShadow: "defaultOverlay",
});
Expand Down
1 change: 0 additions & 1 deletion src/theme/sprinkles.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ const responsiveProperties = defineProperties({
marginX: ["marginLeft", "marginRight"],
marginY: ["marginTop", "marginBottom"],
placeItems: ["alignItems", "justifyContent"],
typeSize: ["fontSize", "lineHeight", "letterSpacing"],
borderWidth: [
"borderTopWidth",
"borderBottomWidth",
Expand Down

0 comments on commit fa11d14

Please sign in to comment.