/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththisfile,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
// We don't sync default theme attributes in `init()`, as we may not have // a root element to attach the attribute to yet. They will be set when // the first LightweightTheme:Set event is delivered during pageshow.
prefersDarkQuery.addEventListener("change", this);
},
/** *HandlethemeupdatesfromtheLightweightThemeChildactorordueto *changestotheprefers-color-schememediaquery. * *@param{object}eventobjectcontainingthethemeorqueryupdate.
*/
handleEvent(event) { if (event.type == "LightweightTheme:Set") { this._setProperties(event.detail.data || {});
} elseif (event.type == "change") { const root = document.documentElement; // If a lightweight theme doesn't apply, update lwt-newtab-brighttext to // reflect prefers-color-scheme. if (!root.hasAttribute("lwt-newtab")) {
root.toggleAttribute("lwt-newtab-brighttext", event.matches);
}
}
},
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.