Skip to content

v1.0.0-beta.5

Pre-release
Pre-release
Compare
Choose a tag to compare
@github-actions github-actions released this 19 Sep 16:30
· 116 commits to main since this release

Minor Changes

  • 842d205: Adds breakpoint tokens.

    Since CSS does not allow custom properties in media queries, these should be used via the
    ScreenSizeController from @rhds/elements

    import { LitElement, html } from 'lit';
    import { classMap } from 'lit/directives/class-map.js';
    import { ScreenSizeController } from '@rhds/elements/lib/controllers/ScreenSizeController.js';
    
    @customElement('responsive-element')
    class ResponsiveElement extends LitElement {
      #screenSize = new ScreenSizeController(this);
    
      render() {
        const isMobilePortrait = this.#screenSize.has('mobile-portrait');
        return html`
          <div id="#container" class="${classMap({ isMobilePortrait })}">
            ...
          </div>
        `;
      }
    }