Locked Video

Please log in or buy the course to watch

Buy Now

Styling Basics

The CSS Function

Panda CSS provides several functions for writing typesafe styles using object syntax. The basic function for styling is the css function.

For example, to style a div with a red background and white text, we write it as:

<div
  className={css({
    backgroundColor: 'red',
    color: 'white',
  })}
>
  Something here
</div>

Shorthand Properties

Panda also provides shorthands for common CSS properties to reduce code verbosity.

backgroundbg
paddingp
marginm
borderRadiusrounded
boxShadowshadow