Skip to Content
DocumentationCustom CSSCSS Variable Reference

CSS Variable Reference

This page lists all CSS variables available for styling in DM Note.

Key Style Variables

CSS variables applied to key elements. Use with [data-state="inactive"] or [data-state="active"] selectors.

VariableDescriptionTypeExample
--key-radiusCorner roundness<length>8px, 50%
--key-bgBackground color<color>#ff2b80
--key-borderBorder style<border>2px solid #fff, none
--key-text-colorText color<color>#ffffff
--key-offset-xX offset in active state<length>0px, 2px
--key-offset-yY offset in active state<length>4px

--key-bg is applied as background-color. To use gradients, specify background or background-image directly and set --key-bg: transparent; if needed.

Usage Example

[data-state="inactive"] { --key-radius: 8px; --key-bg: #2a2a2a; --key-border: 2px solid #444; --key-text-color: #888; } [data-state="active"] { --key-radius: 8px; --key-bg: #ff2b80; --key-border: 2px solid #ff2b80; --key-text-color: #fff; --key-offset-x: 0px; --key-offset-y: 4px; }

Counter Style Variables

CSS variables applied to counter elements. Use with .counter[data-counter-state="..."] selectors.

VariableDescriptionTypeExample
--counter-colorCounter text color<color>#ffffff
--counter-stroke-colorText outline color<color>#000000, transparent
--counter-stroke-widthText outline thickness<length>1px, 2px

Usage Example

.counter[data-counter-state="inactive"] { --counter-color: #666; --counter-stroke-color: transparent; --counter-stroke-width: 0px; } .counter[data-counter-state="active"] { --counter-color: #ff2b80; --counter-stroke-color: #fff; --counter-stroke-width: 1px; }

Graph Style Variables

CSS variables available for graph elements. Disable Inline Styles Priority on the graph to control these via CSS.

VariableDescriptionTypeExample
--graph-bgGraph background<color>rgba(17, 17, 20, 0.85)
--graph-borderGraph border<border>1px solid #7dd3fc
--graph-radiusGraph corner radius<length>10px
--graph-colorLine/bar drawing color<color>#86efac

Usage Example

.kps-graph { --graph-bg: rgba(7, 10, 18, 0.72); --graph-border: 1px solid rgba(125, 211, 252, 0.55); --graph-radius: 12px; --graph-color: #7dd3fc; }

Selector Reference

Key Selectors

SelectorDescription
[data-state="inactive"]All inactive keys
[data-state="active"]All active keys
[data-state="inactive"], [data-state="active"]All keys in all states
.classname[data-state="active"]Active state of keys with specific class

Counter Selectors

SelectorDescription
.counterAll counters
.counter[data-counter-state="inactive"]Inactive counters
.counter[data-counter-state="active"]Active counters
.classname .counter[data-counter-state="active"]Counter of keys with specific class

Graph Selectors

SelectorDescription
.graphClassNameStyle a specific graph container
.graphClassName svgStyle line graph SVG (stroke/fill)
.graphClassName > divStyle the inner plot area (line/bar shared)
.graphClassName > div > divStyle individual bars in bar mode

Standard CSS Properties

In addition to CSS variables, you can freely use the following standard CSS properties:

Commonly Used Properties

[data-state="active"] { /* Shadow effect */ box-shadow: 0px 0px 8px #ff2b80; /* Text shadow */ text-shadow: 0px 0px 4px #ff2b80; /* Transition */ transition: all 0.1s ease-in-out; /* Font style */ font-size: 24px; font-weight: 700; font-family: "Roboto", sans-serif; /* Transform */ transform: scale(1.05); /* Filter */ filter: brightness(1.2); }

Notes

Using !important

Use !important if some styles are not being applied:

[data-state="active"] { --key-bg: #ff2b80 !important; box-shadow: 0px 0px 8px #ff2b80 !important; }

Browser Compatibility

DM Note runs on Chromium-based WebView2, supporting most modern CSS features:

  • CSS Variables (Custom Properties) ✅
  • CSS Grid / Flexbox ✅
  • CSS Animations / Transitions ✅
  • CSS Filters ✅
  • backdrop-filter ✅
  • mix-blend-mode ✅

backdrop-filter does not work when the overlay background is transparent.

Inheritance and Specificity

  1. Global styles are applied first.
  2. Class selectors override global styles.
  3. More specific selectors take precedence.
/* Priority: 1 (lowest) */ [data-state="active"] { --key-bg: red; } /* Priority: 2 */ .blue[data-state="active"] { --key-bg: blue; } /* Priority: 3 (highest) */ .blue.special[data-state="active"] { --key-bg: purple; }