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

32 lines
809 B
JavaScript
Raw Normal View History

import Component from "@ember/component";
2024-11-29 15:42:50 +00:00
export default class SubscribeCard extends Component {
didInsertElement() {
2024-11-29 15:42:50 +00:00
super.didInsertElement(...arguments);
this.cardElement.mount("#card-element");
this.setCardElementStyles();
2024-11-29 15:42:50 +00:00
}
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,
},
},
},
});
2024-11-29 15:42:50 +00:00
}
2024-01-16 17:51:44 +01:00
didDestroyElement() {
2024-11-29 15:42:50 +00:00
super.didDestroyElement(...arguments);
}
}