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

fix: icons shrinking when in a flex context #130

Merged
merged 1 commit into from
Mar 18, 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
4 changes: 4 additions & 0 deletions src/components/atoms/OakIcon/OakIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ export const OakIcon = (props: OakIconProps) => {
alt,
$width = "all-spacing-7",
$height = "all-spacing-7",
$minHeight = $height,
$minWidth = $width,
imageProps,
...rest
} = props;
Expand All @@ -44,6 +46,8 @@ export const OakIcon = (props: OakIconProps) => {
alt={alt ?? iconName}
$width={$width}
$height={$height}
$minHeight={$minHeight}
$minWidth={$minWidth}
placeholder="empty"
// Icons should not be optimised since the SVG is already as small as it can be and should be served directly
unoptimized
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ exports[`OakIcon matches snapshot 1`] = `
.c0 {
position: relative;
width: 2rem;
min-width: 2rem;
height: 2rem;
min-height: 2rem;
font-family: Lexend,sans-serif;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ exports[`InternalShadowRectButton matches snapshot 1`] = `
.c7 {
position: relative;
width: 1.5rem;
min-width: 1.5rem;
height: 1.5rem;
min-height: 1.5rem;
font-family: Lexend,sans-serif;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ exports[`InternalShadowRoundButton matches snapshot 1`] = `
.c9 {
position: relative;
width: 1.5rem;
min-width: 1.5rem;
height: 1.5rem;
min-height: 1.5rem;
font-family: Lexend,sans-serif;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ exports[`OakBackLink matches snapshot 1`] = `
.c1 {
position: relative;
width: 2.5rem;
min-width: 2.5rem;
height: 2.5rem;
min-height: 2.5rem;
font-family: Lexend,sans-serif;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ exports[`OakCheckBox matches snapshot 1`] = `
.c10 {
position: relative;
width: 100%;
min-width: 100%;
height: 100%;
min-height: 100%;
font-family: Lexend,sans-serif;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ exports[`OakDragAndDropInstructions matches snapshot 1`] = `
.c3 {
position: relative;
width: 2rem;
min-width: 2rem;
height: 2rem;
min-height: 2rem;
font-family: Lexend,sans-serif;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ exports[`OakDraggable matches snapshot 1`] = `
.c5 {
position: relative;
width: 2rem;
min-width: 2rem;
height: 2rem;
min-height: 2rem;
font-family: Lexend,sans-serif;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ exports[`OakDraggableFeedback matches snapshot 1`] = `
.c5 {
position: relative;
width: 2rem;
min-width: 2rem;
height: 2rem;
min-height: 2rem;
font-family: Lexend,sans-serif;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ exports[`OakHandDrawnCardWithIcon matches snapshot 1`] = `
.c6 {
position: relative;
width: 4rem;
min-width: 4rem;
height: 4rem;
min-height: 4rem;
font-family: Lexend,sans-serif;
}
Expand Down Expand Up @@ -82,12 +84,24 @@ exports[`OakHandDrawnCardWithIcon matches snapshot 1`] = `
}
}
@media (min-width:750px) {
.c6 {
min-width: 7.5rem;
}
}
@media (min-width:750px) {
.c6 {
height: 7.5rem;
}
}
@media (min-width:750px) {
.c6 {
min-height: 7.5rem;
}
}
<div
className="c0 c1"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ exports[`OakLessonInfoCard component test matches snapshot 1`] = `
.c4 {
position: relative;
width: 2rem;
min-width: 2rem;
height: 2rem;
min-height: 2rem;
font-family: Lexend,sans-serif;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ exports[`OakPrimaryButton matches snapshot 1`] = `
.c7 {
position: relative;
width: 1.5rem;
min-width: 1.5rem;
height: 1.5rem;
min-height: 1.5rem;
font-family: Lexend,sans-serif;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ exports[`OakPrimaryInvertedButton matches snapshot 1`] = `
.c7 {
position: relative;
width: 1.5rem;
min-width: 1.5rem;
height: 1.5rem;
min-height: 1.5rem;
font-family: Lexend,sans-serif;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ exports[`OakRoundIcon matches snapshot 1`] = `
.c1 {
position: relative;
width: 100%;
min-width: 100%;
height: 100%;
min-height: 100%;
font-family: Lexend,sans-serif;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ exports[`OakSecondaryButton matches snapshot 1`] = `
.c7 {
position: relative;
width: 1.5rem;
min-width: 1.5rem;
height: 1.5rem;
min-height: 1.5rem;
font-family: Lexend,sans-serif;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ exports[`OakHintButton matches snapshot 1`] = `
.c10 {
position: relative;
width: 1.5rem;
min-width: 1.5rem;
height: 1.5rem;
min-height: 1.5rem;
font-family: Lexend,sans-serif;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ exports[`OakLessonBottomNav matches snapshot 1`] = `
.c16 {
position: relative;
width: 1.5rem;
min-width: 1.5rem;
height: 1.5rem;
min-height: 1.5rem;
font-family: Lexend,sans-serif;
}
Expand Down Expand Up @@ -359,7 +361,9 @@ exports[`OakLessonBottomNav matches snapshot 1`] = `
.c7 {
position: relative;
width: 100%;
min-width: 100%;
height: 100%;
min-height: 100%;
font-family: Lexend,sans-serif;
}
Expand Down Expand Up @@ -551,7 +555,9 @@ exports[`OakLessonBottomNav matches snapshot 1`] = `
.c7 {
position: relative;
width: 100%;
min-width: 100%;
height: 100%;
min-height: 100%;
font-family: Lexend,sans-serif;
}
Expand Down Expand Up @@ -761,7 +767,9 @@ exports[`OakLessonBottomNav matches snapshot 1`] = `
.c7 {
position: relative;
width: 100%;
min-width: 100%;
height: 100%;
min-height: 100%;
font-family: Lexend,sans-serif;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ exports[`OakLessonNavItem matches snapshot 1`] = `
.c5 {
position: relative;
width: 3.5rem;
min-width: 3.5rem;
height: 3.5rem;
min-height: 3.5rem;
font-family: Lexend,sans-serif;
}

Expand Down Expand Up @@ -66,7 +68,9 @@ exports[`OakLessonNavItem matches snapshot 1`] = `
.c14 {
position: relative;
width: 100%;
min-width: 100%;
height: 100%;
min-height: 100%;
font-family: Lexend,sans-serif;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ exports[`OakLessonReviewItem matches snapshot 1`] = `
.c4 {
position: relative;
width: 100%;
min-width: 100%;
height: 100%;
min-height: 100%;
font-family: Lexend,sans-serif;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ exports[`OakLessonTopNav matches snapshot 1`] = `
.c4 {
position: relative;
width: 2.5rem;
min-width: 2.5rem;
height: 2.5rem;
min-height: 2.5rem;
font-family: Lexend,sans-serif;
}
Expand All @@ -29,7 +31,9 @@ exports[`OakLessonTopNav matches snapshot 1`] = `
.c8 {
position: relative;
width: 100%;
min-width: 100%;
height: 100%;
min-height: 100%;
font-family: Lexend,sans-serif;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ exports[`OakLessonVideoTranscript matches snapshot 1`] = `
.c11 {
position: relative;
width: 1.5rem;
min-width: 1.5rem;
height: 1.5rem;
min-height: 1.5rem;
font-family: Lexend,sans-serif;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ exports[`OakQuizFeedback matches snapshot 1`] = `
.c3 {
position: relative;
width: 100%;
min-width: 100%;
height: 100%;
min-height: 100%;
font-family: Lexend,sans-serif;
}

Expand Down Expand Up @@ -118,7 +120,9 @@ exports[`OakQuizFeedback matches snapshot 1`] = `
.c3 {
position: relative;
width: 100%;
min-width: 100%;
height: 100%;
min-height: 100%;
font-family: Lexend,sans-serif;
}

Expand Down Expand Up @@ -236,7 +240,9 @@ exports[`OakQuizFeedback matches snapshot 1`] = `
.c3 {
position: relative;
width: 100%;
min-width: 100%;
height: 100%;
min-height: 100%;
font-family: Lexend,sans-serif;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ exports[`OakQuizHint matches snapshot 1`] = `
.c12 {
position: relative;
width: 1.5rem;
min-width: 1.5rem;
height: 1.5rem;
min-height: 1.5rem;
font-family: Lexend,sans-serif;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ exports[`OakQuizMatch matches snapshot 1`] = `
.c4 {
position: relative;
width: 2rem;
min-width: 2rem;
height: 2rem;
min-height: 2rem;
font-family: Lexend,sans-serif;
}
Expand Down Expand Up @@ -168,7 +170,9 @@ exports[`OakQuizMatch matches snapshot 1`] = `
.c9 {
position: relative;
width: 2rem;
min-width: 2rem;
height: 2rem;
min-height: 2rem;
font-family: Lexend,sans-serif;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ exports[`OakQuizOrder matches snapshot 1`] = `
.c4 {
position: relative;
width: 2rem;
min-width: 2rem;
height: 2rem;
min-height: 2rem;
font-family: Lexend,sans-serif;
}
Expand Down Expand Up @@ -168,7 +170,9 @@ exports[`OakQuizOrder matches snapshot 1`] = `
.c12 {
position: relative;
width: 2rem;
min-width: 2rem;
height: 2rem;
min-height: 2rem;
font-family: Lexend,sans-serif;
}
Expand Down