Socket
Socket
Sign inDemoInstall

@3mo/theme

Package Overview
Dependencies
Maintainers
3
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@3mo/theme - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

4

dist/Accent.js
import { css, unsafeCSS } from '@a11d/lit';
import { RootCssInjector } from '@a11d/lit-application';
import { RootCssInjector } from '@a11d/root-css-injector';
import { LocalStorage } from '@a11d/local-storage';

@@ -46,3 +46,3 @@ import { Color } from '@3mo/color';

this.styleElement = RootCssInjector.inject(css `
[application] {
:root {
--mo-color-accent-base-r:${unsafeCSS(medianColor === null || medianColor === void 0 ? void 0 : medianColor.r)};

@@ -49,0 +49,0 @@ --mo-color-accent-base-g:${unsafeCSS(medianColor === null || medianColor === void 0 ? void 0 : medianColor.g)};

@@ -8,3 +8,2 @@ import { LocalStorage } from '@a11d/local-storage';

export declare class BackgroundStorage extends LocalStorage<Background> {
private application?;
constructor();

@@ -11,0 +10,0 @@ get calculatedValue(): Background.Light | Background.Dark;

@@ -1,2 +0,1 @@

import { Application } from '@a11d/lit-application';
import { LocalStorage } from '@a11d/local-storage';

@@ -8,7 +7,4 @@ export class BackgroundStorage extends LocalStorage {

window.matchMedia('(prefers-color-scheme: light)').onchange = () => this.updateAttributeValue();
Application.addInitializer(application => {
this.application = application;
this.updateAttributeValue();
this.changed.subscribe(() => this.updateAttributeValue());
});
this.updateAttributeValue();
this.changed.subscribe(() => this.updateAttributeValue());
}

@@ -23,5 +19,4 @@ get calculatedValue() {

updateAttributeValue() {
var _a;
(_a = this.application) === null || _a === void 0 ? void 0 : _a.setAttribute('data-theme', this.calculatedValue);
document.documentElement.setAttribute('data-theme', this.calculatedValue);
}
}

@@ -23,3 +23,3 @@ import { css } from '@a11d/lit';

[application][data-theme=light] {
:root[data-theme=light] {
color-scheme: light;

@@ -39,3 +39,3 @@ --mo-color-background-base: 255, 255, 255;

[application][data-theme=dark] {
:root[data-theme=dark] {
color-scheme: dark;

@@ -53,3 +53,3 @@ --mo-color-background-base: 0, 0, 0;

[application] {
:root {
--mo-font-family: Roboto, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;

@@ -56,0 +56,0 @@ --mo-border-radius: 4px;

@@ -8,3 +8,2 @@ import { LocalStorage } from '@a11d/local-storage';

export declare class BackgroundStorage extends LocalStorage<Background> {
private application?;
constructor();

@@ -11,0 +10,0 @@ get calculatedValue(): Background.Light | Background.Dark;

{
"name": "@3mo/theme",
"version": "0.0.2",
"version": "0.0.3",
"description": "Tools & tokens for theming 3MO components & applications.",

@@ -26,3 +26,3 @@ "repository": {

"@a11d/local-storage": "x",
"@a11d/lit-application": "x",
"@a11d/root-css-injector": "x",
"@3mo/color": "x",

@@ -29,0 +29,0 @@ "tslib": "x"

# Theme
Tools & tokens for theming 3MO components & applications.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc