Sanctuary

    Flavor
    Accent
    Glazing
    Window

    Foundations

    Light

    Elevation as illumination: Lumen for hierarchy, Cast for state, Halo for focus.

    Material Design models elevation as distance from a light above. Sanctuary models it as illumination: in a dark room, what is closer to you is better lit. Use Lumen for hierarchy and Cast for state; a surface should rarely need both at full strength. See both in the playground.

    Lumen

    Each level pairs a lighter stone (surface-raised-n) with a deeper umbra (elevation-n). The stone stops at level 4, where Lauds already reaches white, so level 5, for modals and the most prominent floating surfaces, pairs surface-raised-4 with the deepest umbra. In Lauds the shadow does most of the work.

    .card {
      background: var(--san-surface-raised-2);
      box-shadow: var(--san-elevation-2);
    }
    
    TokenValue
    --san-elevation-00px 0px 0px 0px umbra-key, 0px 0px 0px 0px umbra-ambient
    --san-elevation-10px 1px 2px 0px umbra-key, 0px 1px 3px 1px umbra-ambient
    --san-elevation-20px 2px 4px -1px umbra-key, 0px 4px 10px 0px umbra-ambient
    --san-elevation-30px 4px 8px -2px umbra-key, 0px 10px 24px 0px umbra-ambient
    --san-elevation-40px 8px 16px -4px umbra-key, 0px 18px 40px 0px umbra-ambient
    --san-elevation-50px 12px 24px -6px umbra-key, 0px 32px 64px 0px umbra-ambient

    The shadows are drawn in umbra-key and umbra-ambient, which each flavor sets; see the token reference.

    Cast

    Cast is the colored glow that glass throws on its surroundings: --san-cast-sm, --san-cast-md and --san-cast-lg. It signals energy: hover, selection, an active window. Cast follows the accent, so it exists only in the stylesheet, computed from it.

    Halo

    --san-halo is the focus ring: a band of stone and then a ring of the accent, which clears the 3:1 contrast that WCAG asks of focus indicators.

    .button:focus-visible {
      outline: none;
      box-shadow: var(--san-halo);
    }
    

    State layers

    Hover, focus and pressed are layers of the content color laid over a control. The stylesheet computes --san-state-hover, --san-state-focus and --san-state-pressed from currentColor, so they follow whatever color the content has. The token files hold their opacities, with those for disabled content and containers:

    TokenValue
    --san-state-hover0.08
    --san-state-focus0.12
    --san-state-pressed0.16
    --san-state-disabled-content0.38
    --san-state-disabled-container0.12

    Blur

    For glass surfaces, such as flashed glazing over an image:

    TokenValue
    --san-blur-sm8px
    --san-blur-md16px
    --san-blur-lg32px