Skip to content

Commit 1c118a3

Browse files
CORE-1997: Remove styled-components from theme files
- Remove styled-components imports from src/theme.ts - Remove styled-components imports from src/theme/buttons.ts - Convert css helper usages to plain template strings - Remove the desktop() helper function from breakpoints - Update components to use breakpoints.desktopBreak directly in media queries - Remove unused css imports from NavBar.tsx and NavBarLogo.tsx 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 829b443 commit 1c118a3

4 files changed

Lines changed: 11 additions & 18 deletions

File tree

src/components/NavBar.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import styled, { css } from 'styled-components';
1+
import styled from 'styled-components';
22
import * as Constants from '../../src/constants';
33
import theme from '../../src/theme';
44
import { BodyPortal } from './BodyPortal';
@@ -11,9 +11,9 @@ const BarWrapper = styled(BodyPortal)`
1111
position: relative;
1212
padding: 0 ${theme.padding.navbar.mobile}rem;
1313
box-shadow: 0 0.2rem 0.2rem 0 rgba(0, 0, 0, 0.1);
14-
${theme.breakpoints.desktop(css`
14+
@media screen and (min-width: ${theme.breakpoints.desktopBreak}em) {
1515
padding: 0 ${theme.padding.navbar.mobile}rem;
16-
`)}
16+
}
1717
min-width: 0;
1818
`;
1919

@@ -30,9 +30,9 @@ const StyledNavBar = styled.div<{
3030
height: ${props => props.navMobileHeight}rem;
3131
${props => props.maxWidth ? `max-width: ${props.maxWidth}rem;` : null}
3232
margin: 0 auto;
33-
${props => theme.breakpoints.desktop(css`
34-
height: ${props.navDesktopHeight}rem;
35-
`)}
33+
@media screen and (min-width: ${theme.breakpoints.desktopBreak}em) {
34+
height: ${props => props.navDesktopHeight}rem;
35+
}
3636
@media print { display: none; }
3737
`;
3838

src/components/NavBarLogo.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import theme from "../../src/theme";
2-
import styled, { css } from "styled-components";
2+
import styled from "styled-components";
33
import { navLogoDesktopHeight, navLogoMobileHeight } from "../../src/constants";
44

55

66
const StyledLogo = styled.svg`
77
display: block;
88
width: auto;
99
height: ${navLogoMobileHeight}rem;
10-
${theme.breakpoints.desktop(css`
10+
@media screen and (min-width: ${theme.breakpoints.desktopBreak}em) {
1111
height: ${navLogoDesktopHeight}rem;
12-
`)}
12+
}
1313
`;
1414

1515
export const NavBarLogo = ({ alt }: { alt: string; }) => (

src/theme.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { css, FlattenSimpleInterpolation } from "styled-components";
21
import { palette } from "./theme/palette";
32

43
export const colors = {
@@ -26,7 +25,7 @@ export const padding = {
2625
},
2726
};
2827

29-
export const defaultFocusOutline = css`
28+
export const defaultFocusOutline = `
3029
outline: 0.2rem auto Highlight;
3130
outline: 0.2rem auto -webkit-focus-ring-color;
3231
`;
@@ -38,11 +37,6 @@ export const breakpoints = {
3837
mobileNavBreak,
3938
mobileBreak,
4039
desktopBreak,
41-
desktop: (style: FlattenSimpleInterpolation) => css`
42-
@media screen and (min-width: ${desktopBreak}em) {
43-
${style}
44-
}
45-
`,
4640
};
4741

4842
const theme = {

src/theme/buttons.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { css } from "styled-components";
21
import { palette } from "./palette";
32

43
export type ButtonVariant = keyof typeof buttonStyleSets;
@@ -46,7 +45,7 @@ const buttonStyleSets = asButtonStyleSetTypes({
4645

4746
export const applyButtonVariantStyles = (variant: ButtonVariant) => {
4847
const set = buttonStyleSets[variant];
49-
return css`
48+
return `
5049
background-color: ${set.background};
5150
color: ${set.color};
5251
font-weight: ${set.fontWeight ?? 700};

0 commit comments

Comments
 (0)