PR: Custom Color Choice (#38)

This commit is contained in:
Jordan Vidrine
2025-03-11 14:45:04 -05:00
committed by GitHub
parent 664e3a5910
commit d1800ffd98
10 changed files with 183 additions and 3 deletions
@@ -0,0 +1,31 @@
import Component from "@glimmer/component";
import { fn } from "@ember/helper";
import { action } from "@ember/object";
import { service } from "@ember/service";
import { htmlSafe } from "@ember/template";
import DButton from "discourse/components/d-button";
export default class SitePallette extends Component {
@service customColor;
get siteStyle() {
return `--icon-color: ${this.args.colorScheme.color}`;
}
@action
handleInput(colorScheme) {
this.customColor.setColor(colorScheme.name);
}
<template>
<div class="color-pallette-menu__item">
<DButton
class="btn-flat color-pallette-menu__item-choice"
style={{htmlSafe this.siteStyle}}
@icon="circle"
@translatedLabel={{@colorScheme.name}}
@action={{fn this.handleInput @colorScheme}}
/>
</div>
</template>
}