Deft
Ask AI

Search

Search skills, authors and topics

design-mobile-apps

Design mobile app screens with Sleek, edit Sleek projects, and implement their designs in React Native or HTML.

Install

npx skills add https://github.com/designed-by-ai/skills --skill design-mobile-apps

Styling: StyleSheet

React Native's built-in styling. Reached from React Native (Expo) when the repo has no styling library.

Colors

React Native's color parser reads hex, rgb() and named colors and carries no oklch matcher, so a raw oklch(...) token resolves to nothing. Convert each one from the document's :root block to hex or rgb() once, in the token module, and every consumer stays correct.

Units

React Native styles use unitless numbers in density-independent pixels. Resolve Tailwind's 0.25rem spacing steps against the HTML's root font size; the examples below assume the default 16px root:

ClassStyle
p-4padding: 16
px-5 py-3paddingHorizontal: 20, paddingVertical: 12
gap-3gap: 12
text-smfontSize: 14
rounded-xlborderRadius: the resolved --radius-xl number
w-1/2width: '50%' (percentages are strings)

Resolve rem and em against their source font sizes. Use useWindowDimensions() for viewport-relative sizes, then pass numeric native values.

Composition

  • One StyleSheet.create({ … }) per component file, holding everything static.
  • Conditional styling composes with arrays: style={[styles.card, isActive && styles.cardActive]}.
  • Values that genuinely change per render — a measured width, an animated height — stay inline; everything else lives in the sheet.