Note: Version bump only for package @spectrum-web-components/base
Note: Version bump only for package @spectrum-web-components/base
- sp-button-group: sp-button-group react to size updates (#5037) (63bc618)
Note: Version bump only for package @spectrum-web-components/base
Note: Version bump only for package @spectrum-web-components/base
Note: Version bump only for package @spectrum-web-components/base
Note: Version bump only for package @spectrum-web-components/base
Note: Version bump only for package @spectrum-web-components/base
Note: Version bump only for package @spectrum-web-components/base
- breadcrumbs: adjust ref directives imports (#4681) (6e7ba13)
Note: Version bump only for package @spectrum-web-components/base
Note: Version bump only for package @spectrum-web-components/base
Note: Version bump only for package @spectrum-web-components/base
Note: Version bump only for package @spectrum-web-components/base
Note: Version bump only for package @spectrum-web-components/base
Note: Version bump only for package @spectrum-web-components/base
- base: move lit imports to base (#4416) (b7cb07e)
- styles,theme: add S2 tokens and theme (#4241) (a29e4a2), closes #4232 #4228
Note: Version bump only for package @spectrum-web-components/base
Note: Version bump only for package @spectrum-web-components/base
Note: Version bump only for package @spectrum-web-components/base
Note: Version bump only for package @spectrum-web-components/base
Note: Version bump only for package @spectrum-web-components/base
Note: Version bump only for package @spectrum-web-components/base
Note: Version bump only for package @spectrum-web-components/base
Note: Version bump only for package @spectrum-web-components/base
Note: Version bump only for package @spectrum-web-components/base
Note: Version bump only for package @spectrum-web-components/base
Note: Version bump only for package @spectrum-web-components/base
Note: Version bump only for package @spectrum-web-components/base
Note: Version bump only for package @spectrum-web-components/base
Note: Version bump only for package @spectrum-web-components/base
Note: Version bump only for package @spectrum-web-components/base
Note: Version bump only for package @spectrum-web-components/base
Note: Version bump only for package @spectrum-web-components/base
- base: add re-export of lit/directive.js (#3616) (d2e237f)
- base: introduce static version property for component class (#3582) (e7e2b76)
Note: Version bump only for package @spectrum-web-components/base
- overlay: ship Overlay API v2 (67b5d1b)
Note: Version bump only for package @spectrum-web-components/base
Note: Version bump only for package @spectrum-web-components/base
Note: Version bump only for package @spectrum-web-components/base
Note: Version bump only for package @spectrum-web-components/base
Note: Version bump only for package @spectrum-web-components/base
- base: ensure streaming listener "streams" on the animation frame (1478db1)
Note: Version bump only for package @spectrum-web-components/base
- shared pkg versions, devmode define warning, registry-conflicts docs (6e49565)
- reduce render cycles when managing "dir" attribute (7b28309)
- reduce render cycles when managing "dir" attribute (7b28309)
Note: Version bump only for package @spectrum-web-components/base
Note: Version bump only for package @spectrum-web-components/base
Note: Version bump only for package @spectrum-web-components/base
Note: Version bump only for package @spectrum-web-components/base
- include all Dev Mode files in side effects (f70817c)
- delivery dev mode messages in various packages (62370a1)
- add when directive (18b7405)
Note: Version bump only for package @spectrum-web-components/base
- move property management into update or willUpdate (f66069f)
- allow dir to be managed across multiple connections and disconnections (6d93170)
Note: Version bump only for package @spectrum-web-components/base
- add Grid pattern (341f493)
- dialog: updates for delivering dialog content accessibly (f0ed33c)
- add t-shirt sizing to Thumbnail and support for "xxs"/"xs" sizes (520a642)
- update lit-* dependencies, wip (377f3c8)
- abstract "hasVisibleFocusInTree" functionality and return trigger focus after close (4f39f2c)
Note: Version bump only for package @spectrum-web-components/base
Note: Version bump only for package @spectrum-web-components/base
- allow for late loading theme scopes (4c7a124)
- remove right click value setting (a44968d)
Note: Version bump only for package @spectrum-web-components/base
- support a wider number of sizes (ee44978)
- use latest exports specification (a7ecf4b)
- expand sized functionality to support no default and returning to default values (acf3cfb)
- reduce cycles (8917a5e)
Note: Version bump only for package @spectrum-web-components/base
Note: Version bump only for package @spectrum-web-components/base
- textfield: reimplement min/maxlength (23a4c2e)
- include the "types" entry in package.json files (b432f59)
- apply sizedMixin for t-shirt sizing (d7b63fb)
- use SixedMixin to manage "size" property (8819821)
- story-decorator: add story decorator to replace knobs for theme application (7c0c6be)
- include the "types" entry in package.json files (b432f59)
- apply sizedMixin for t-shirt sizing (d7b63fb)
- use SixedMixin to manage "size" property (8819821)
- story-decorator: add story decorator to replace knobs for theme application (7c0c6be)
- base: use full file extension (6ea4d9d)
- include default export in the "exports" fields (f32407d)
- dir should never fall back to null (6b16c6d)
- allow dir management by sp-theme elements (2d10158)
- observe document.documentElement for dir value (da84a9a)
- update to Spectrum CSS v3.0.0 (e8b3d8f)
- card: upgrade to Spectrum CSS v3.0.0 (84cf1a9)
- use 3.0.0-beta.* release for styles (877b485)
- base: insert Spectrum base class/mixin (37c2ee9)
The SpectrumElement
base class as created by mixing SpectrumMixin
onto LitElement
adopts dir
values from the document
at connection time with a fallback to lrt
. In a TypeScript context, it also enforces the presence of this.shadowRoot
on extending components.

yarn add @spectrum-web-components/base
When looking to leverage the SpectrumElement
base class as a type and/or for extension purposes, do so via:
import { SpectrumElement } from '@spectrum-web-components/base';
export MyElement extends SpectrumElement {}
Similarly the SpectrumMixin
class factory mixin is available via:
import { SpectrumMixin } from '@spectrum-web-components/base';
export MyElement extends SpectrumMixin(HTMLElement) {}
With powerful CSS selectors like :host(:dir(rtl))
and :host-content([dir=rtl])
not yet enjoying cross-browser support, reliably delivering content in both "left to right" and "right to left" while relying on Shadow DOM means certain trade offs need to be made. While every custom element build from SpectrumMixin
could have its dir
attribute applied to manage this, doing so is not only a pain for apply, it's a pain to maintain over time. To support the flexibility to deliver content in both of these directions, elements built from SpectrumMixin
will observe the dir
attribute of either the document
or a containing sp-theme
. This will allow your sites and applications to manage content direction in a single place while also opening the possibility of having multiple content directions on the same page by scoping those content sections with sp-theme
elements.
Placing a dir
attribute on an element built from SpectrumMixin
before attaching it to the DOM will prevent it from resolving the text direction value to a parent sp-theme
or document
element. Elements applied to the page in this way will also NOT participate in observing any such elements, so their dir
values will remain as initialized regardless of changes in other parts of your documents. If you choose to leverage this, be aware that any child (in both light DOM and shadow DOM) of this element will need to have a dir
attribute applied as well if you do not want it resolving to a parent sp-theme
or document
element itself. In this way, it is likely that you would benefit from leveraging an sp-theme
element to create scope in your document for managing this custom content direction section of your page.
While CSS offers many powerful solutions for styling content in various directions, sometimes JS functionality depends on the specific of that direction. Elements built from SpectrumMixin
have the this.isLTR
getter that will resolve to true
when dir === 'ltr'
.
public shadowRoot!: ShadowRoot;
Elements built from SpectrumMixin
assume that you will be using shadow DOM in the resulting custom element. To simplify TypeScript usage the presence of this.shadowRoot
is asserted as non-null so that you have direct access to it without extended type checking.