Master 1Password: vaults, Watchtower, passkeys, SSH agent, CLI, and family/team administration. Use when getting full value from 1Password personally or administering it for others.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Style React with Emotion: css prop, styled API, theming, SSR, and zero-config patterns. Use when choosing or using Emotion for CSS-in-JS.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
설치 방법 보기설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.
A practical guide to Emotion: the flexible CSS-in-JS library for React — the css prop, styled API, theming, SSR extraction, and the configuration choices (babel preset, labels) that make it pleasant.
Emotion offers two APIs for the same engine: the css prop (<div css={css...}>, JSX pragma or automatic runtime) for inline styling, and styled (same idea as styled-components) for reusable components. It's fast, SSR-friendly, and framework-agnostic at its core (@emotion/css works without React). The css prop shines for one-off styles; styled for repeated components — most codebases use both.
ThemeProvider from @emotion/react.@emotion/css (vanilla JS, other frameworks).css prop. <div css={{ color: 'hotpink' }}> (object) or css`color: hotpink;` (template). Needs the JSX transform configured: /** @jsxImportSource @emotion/react */ or babel preset @emotion/babel-preset-css-prop.styled. import styled from '@emotion/styled' — same API shape as styled-components; components interchangeable in most patterns.ThemeProvider from @emotion/react; useTheme() hook; ${props => props.theme.x} interpolations. Type via module augmentation like styled-components.css results compose: css={[base, isActive && active]} — arrays merge, later wins. Clean variant handling without template gymnastics.Global. <Global styles={css...} /> for resets and base styles.@emotion/babel-plugin adds label: ComponentName; to generated classes — readable DevTools. Also enables better minification and source maps.extractCritical (v10) / framework integrations collect used styles server-side. Next.js App Router needs the documented Emotion SSR setup to avoid hydration mismatches.1. Setup.
npm i @emotion/react @emotion/styled
# babel: presets: ['@emotion/babel-preset-css-prop'] (enables css prop + labels)
Or with the new JSX transform: set jsxImportSource: '@emotion/react' in tsconfig + per-file pragma comment where needed.
2. Patterns.
/** @jsxImportSource @emotion/react */
import { css, useTheme } from '@emotion/react';
import styled from '@emotion/styled';
// ad-hoc: css prop with array composition
const base = css`padding: 12px 20px; border-radius: 8px;`;
const primary = (theme) => css`background: ${theme.colors.brand}; color: white;`;
function Button({ variant, children }) {
const theme = useTheme();
return <button css={[base, variant === 'primary' && primary(theme)]}>{children}</button>;
}
// reusable: styled
const Card = styled.div`
border-radius: ${({ theme }) => theme.radii.lg};
box-shadow: ${({ theme }) => theme.shadows.md};
`;
3. Theme + types. Define theme object, augment @emotion/react's Theme interface, wrap app in ThemeProvider.
4. SSR. Follow the framework-specific Emotion SSR docs (critical CSS extraction on server, cache provider for App Router). Verify: no unstyled flash, no hydration warnings.
5. Object styles vs template. Object styles (css={{...}}) are lintable/typeable and compose well; template literals are better for complex selectors and media queries. Pick per case, stay consistent per file.
css prop does nothing (or errors) without the pragma/babel preset/jsxImportSource. The #1 "Emotion isn't working" cause.@emotion/babel-plugin.css prop type. The babel preset or jsxImportSource + @emotion/react types fix it.css prop = unmaintainable snowflakes. Promote repeated patterns to styled components.<Global> inside a frequently-rendered component re-injects. Render once at root.아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.
로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.
아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.
Master 1Password: vaults, Watchtower, passkeys, SSH agent, CLI, and family/team administration. Use when getting full value from 1Password personally or administering it for others.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Create 3D visuals with modeling, texturing, lighting, rendering, and optimization for web and product.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Create 3D web experiences: scene setup, models, materials, lighting, animation, scroll-driven scenes, and performance budgets. Use when adding 3D to websites beyond basic demos.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Writing abstracts that get papers read — structured content, the 5-sentence core, and journal-specific constraints.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Learn effectively from courses and academies: choosing programs, studying actively, and converting courses into skills. Use when investing time/money in structured learning.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Audit designs for accessibility with WCAG checklists covering color, type, focus, motion, and content.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.