discourse-subscriptions/assets/javascripts/discourse/components/subscribe-card.js

29 lines
735 B
JavaScript
Raw Normal View History

import Component from "@ember/component";
export default Component.extend({
didInsertElement() {
this._super(...arguments);
this.cardElement.mount("#card-element");
this.setCardElementStyles();
},
setCardElementStyles() {
const root = document.querySelector(":root");
const computedStyle = getComputedStyle(root);
const primaryColor = computedStyle.getPropertyValue("--primary");
const placeholderColor =
computedStyle.getPropertyValue("--secondary-medium");
this.cardElement.update({
style: {
base: {
color: primaryColor,
"::placeholder": {
color: placeholderColor,
},
},
},
});
},
2020-09-16 10:53:50 -04:00
didDestroyElement() {},
});