CSS Editing Tools
Espresso includes tools for modifying your stylesheets without typing the CSS: sliders, color pickers and menus that write the declarations for you. They are in the inspector, at the right of the window, when you are editing a CSS, SCSS or LESS file. If the inspector is not showing, choose View ⟩ Show Inspector (option command I).
To use the tools, place your text cursor anywhere inside the rule you want to modify, and then adjust its properties in the inspector. What you change is written into the rule as you change it, and a preview of a page that uses the stylesheet shows the result. If you select several rules, a tool shows a value only where the rules agree.
Pages
The buttons at the top of the inspector choose a page of tools:
- The first page shows what this rule sets: only the properties the rule already declares. It is where the inspector starts, and for most rules it is short.
- Text: font, size, color, alignment, spacing and other properties of text and paragraphs
- Appearance: backgrounds and gradients, borders, shadows, opacity, filters, transforms and other decoration and effects
- Layout: size, margins and padding, position, display, and flexbox and grid
- More: transitions and animations, cursors and other behavior, and the rule's variables (custom properties)
Click the title of a section to close it or open it.
Finding a property
If you know the name of a property, type it in the Find a Property field at the top of the inspector. The inspector shows the tools whose names match, from every page: type gap or radius and the tool is there.
Using the tools
Most of the tools should be largely self-explanatory, but here are some tips for using them:
- In a number field, press up and down to change the value by one, or by ten with shift, or scroll over the field. Type a unit after a number to change the unit, or choose one from the field's menu.
- The menu of a field also has the keywords the property takes, and the variables you can use for it, which are written as
var(--name) - Empty a field to remove the declaration from the rule
- Click a color swatch for the color picker. The field's menu has your recent colors and the named colors.
- Backgrounds and shadows are lists: add as many layers as you want. A background layer can be an image or a linear, radial or conic gradient, repeating or not, and you place a gradient's stops by dragging them.
- For a grid, the tracks are drawn in proportion: select a track to size it, and add or remove tracks. To place an item on its grid, drag across the cells it should cover.
- For a transition or an animation, choose Curve… from the easing menu to draw the timing curve, or to set up steps
- From an animation's name you can create its
@keyframesand add stops to them - Variables lists the custom properties the rule declares, and lets you add, rename and remove them
Values that the tools cannot show as a control, such as calc() and clamp() expressions, are kept exactly as you wrote them.
What the tools write
The tools write CSS the way your stylesheet is written:
- A new declaration is indented as the rest of the stylesheet is, with tabs or with spaces
- A color keeps the notation it was written in, whether that is hex,
rgb(),hsl()oroklch() - Where a rule sets all four sides of a margin, padding or border radius, they are written as the shorthand; otherwise as the separate properties
- Changes are ordinary edits to the document, so Edit ⟩ Undo takes them back
Browser compatibility
The tools write standard CSS and no longer add -webkit- or -moz- variants of properties, which current browsers do not need. If a rule already has prefixed declarations, they are kept in step with the standard one.
Some of the newer properties the tools offer are not understood by older browsers. Browser compatibility for CSS properties is a topic that is changing too fast to document here, but you can find more information about which browsers support which CSS properties by searching the web.