Files
webawesome/docs/docs/themes/matter.md
Cory LaViska b96c3f318b Simplify native styles (#993)
* move print styles

* begin native styles split

* unsplit button styles 😓

* unsplit callout; remove .wa-callout

* merge forms

* remove unused

* remove unused

* unsplit checkbox

* remove old astro config

* remove overflow

* unsplit slider

* fix tooltip position in RTL

* unsplit radio

* move required light DOM styles to <wa-page>

* remove unused file

* remove unused import

* remove

* goodbye

* fix examples

* unsplit dialog

* unsplit select

* remove select

* unsplit input

* unsplit details

* update

* update comment

* update textarea

* combine native docs; improvements

* update

* reorg and fix headings

* fix details summary padding; fixes #684

* update

* fix native details summary padding; fixes #684

* #684

* remove passthrough style nonsense

* it's CSS not JS

* fix details in sidebar

* add spacing in native buttons for icons

* whitespace

* update docs

* remove button group util

* remove shadow folder, add component folder

* layerize

* default border radius

* remove color contrast script from dist

* add term

* layerize themes + color folders

* reorder

* remove radio button; #504

* remove visual tests

* remove visual tests

* remove unused stylesheet

* make search smarter

* add radio styles

* Fix filled textareas

* re-introduce visual tests (with adjustments)

* fix button appearances

* fix textarea focus styles

* re-introduce appearance classes

* remove 'native styles' note from component pages

* fix checked radio styles

* touch up callout styles

* remove errant `.wa-tag`

* scope appearance classes to relevant elements

* more visual test cases

* fix details borders

* minor visual tests reorg

* add `--box-shadow` to buttons

* fix Awesome theme

* use same layer for all themes (allows unset properties to inherit from Default theme)

* fix box-shadow in wa-textarea

* set button box shadow to `initial`

* fix Active theme

* fix Brutalist theme

* fix Glossy theme

* fix Matter theme (mostly)

* fix Playful theme

* fix Premium theme

* fix Shoelac theme

* fix Tailspin theme

* fix custom radio button styles

* fix links to native styles doc

---------

Co-authored-by: lindsaym-fa <dev@lindsaym.design>
2025-05-29 13:10:53 -04:00

2.5 KiB

title, description, isPro, tags, fonts
title description isPro tags fonts
Matter Digital design inspired by the real world. true pro
body code longform
Wix Madefor Text Roboto Mono Roboto Serif

Set the page theme to "{{ title }}" from the top right to preview the following examples.

Floating Labels

This theme implements "floating labels" for wa-input, wa-textarea, wa-select, which makes labels look like placeholders when the input is empty, does not have an actual placeholder, and is not focused.

<wa-input label="What is your name?"></wa-input>
<br>
<wa-input label="What is your name?" appearance="filled"></wa-input>

Ripple Effect

This theme implements a ripple effect for buttons, including native buttons. Click on the following buttons to observe it:

<wa-button variant="brand">Button</wa-button>
<button class="wa-brand">Button</button>

Customization

You can use several properties to customize the ripple effect.

These properties can be set on any ancestor, including the root element:

Property Type Default Description
--wa-ripple-start-radius <length> 0.1em The starting radius of the ripple effect.
--wa-ripple-start-opacity <number> 0.1 The starting opacity of the ripple effect.
--wa-ripple-duration <time> calc(2 * var(--wa-transition-slow)) The duration of the ripple effect transition.

Any of these can be used to disable the ripple effect:

--wa-ripple-start-radius: 0em;
--wa-ripple-start-opacity: 0;
--wa-ripple-duration: 0s;

These properties would only work on the button itself:

Property Type Default Description
--wa-ripple-center-x <percentage> 50% The x-coordinate of the ripple center point as a percentage of the button width.
--wa-ripple-center-y <percentage> 50% The y-coordinate of the ripple center point as a percentage of the button height.

Ripple Center Point

By default the ripple effect starts from the center of the button. If you want it to start from the position the button was clicked, you can use this JS snippet:

document.addEventListener("mousedown", evt => {
	let target = evt.target;

	if (!target.matches?.('wa-button, button')) {
		return;
	}

	let rect = target.getBoundingClientRect();
	let x = (evt.clientX - rect.left) / rect.width;
	let y = (evt.clientY - rect.top) / rect.height;

	target.style.setProperty("--mouse-local-x", x);
	target.style.setProperty("--mouse-local-y", y);
});