gillish

Buttons that answer back

A hand holding a phone outdoors, the thumb pressing a green button on the screen.

Written by

in

A good button tells the visitor it heard them. It lifts a little when the mouse comes near, dips when it is pressed, and shows a clear ring when someone reaches it with the Tab key. In Cairnstone you set all three in the Styles tab, with no code.

One button, four looks

At the top of the Styles tab in Cairnstone → Blocks sit five state buttons: Default, Hover, Focus, Active and Disabled. Default is the look at rest. Every other state starts from Default, so you only change what should be different.

A dental clinic's Book an appointment button in the editor, with Hover picked in the Styles tab, the line 4 changes and Reset Hover, and Copy styles from.
Hover picked, with four changes of its own.

Build it

Make a button that answers back

  1. In Cairnstone → Blocks, add a Button and select it.

  2. Open the Styles tab. With Default picked, set the button’s background colour, text colour and corners.

  3. Pick Hover. Under Color, choose a darker shade for the background. Under Advanced, set Move up / down to -1. Under Shadow, set Elevation to Medium.

  4. Pick Active. Under Advanced, set Move up / down to 1, and under Shadow, set Elevation to None, so the shadow goes away while the button is pressed. Not set would keep the Hover shadow.

  5. Pick Focus. Under Border, set Outline width to 2, Outline style to Solid, Outline color to your accent and Outline offset to 2.

  6. Under Advanced, set Transition to 200. It is one value for the whole button. Save the block.

See it before you publish

You do not need to publish to check it. Pick a state button, and the canvas draws the button in that look. Point at the button on the canvas, and it lifts as it will on the page.

A Start the free lesson button in the editor, and the Advanced section in the Hover state with Move up / down at -6, Scale at 108, Pivot point Centre and Transition.
A button that rises and grows on hover.

Why the ring matters

Many people move through a page with the keyboard. The ring shows them where they are. An outline is drawn just outside the block and takes up no space, so turning it on never moves anything around it.

A Download for Mac button with a dark ring around it in the editor, and the Border section in the Focus state with Outline width 3, Outline style Solid and Outline offset 3.
An outline as a focus ring, set in the Focus state.

Calm for those who need it

Some visitors ask their device for less motion. For them, the lift and the dip snap into place, while the colour and the shadow still fade gently. You do not have to set anything for this.

Use it on every page

Place the button in any post or page. It brings its look with it, every state included, and you change the words and the link right there.

Every control in the Styles tab is in Learn every setting in Cairnstone’s block sidebar.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *