don't use action for theme
This commit is contained in:
parent
b23f38865f
commit
3984cade66
2 changed files with 6 additions and 5 deletions
|
|
@ -5,7 +5,7 @@
|
|||
* @required
|
||||
*/
|
||||
export let text: string;
|
||||
|
||||
|
||||
import { marked } from 'marked';
|
||||
import Block from '../Block/Block.svelte';
|
||||
</script>
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
<style lang="scss" global>
|
||||
// Same as body text... we probably should unbind these styles from the component
|
||||
// and import them in the app through a separate scss file.
|
||||
@import "../../scss/mixins";
|
||||
@import '../../scss/mixins';
|
||||
|
||||
div.article-block.notes {
|
||||
@include note-text;
|
||||
|
|
|
|||
|
|
@ -23,18 +23,19 @@
|
|||
*/
|
||||
export let base: Base = 'light';
|
||||
|
||||
import cssVariables from '../../actions/cssVariables';
|
||||
import flatten from './utils/flatten';
|
||||
import mergeThemes from './utils/merge';
|
||||
|
||||
/** @type {Theme} */
|
||||
$: mergedTheme = mergeThemes({}, themes[base] || themes.light, theme);
|
||||
|
||||
$: cssVariables = Object.entries(flatten({ theme: mergedTheme })).map(([key, value]) => `--${key}: ${value};`).join(' ');
|
||||
</script>
|
||||
|
||||
<div
|
||||
class="theme"
|
||||
style="display: contents;"
|
||||
use:cssVariables="{flatten({ theme: mergedTheme })}"
|
||||
style="{cssVariables}"
|
||||
style:display="contents"
|
||||
>
|
||||
<!-- Clients can override the theme above by attaching custom properties to this element. -->
|
||||
<div class="theme-client-override" style="display: contents;">
|
||||
|
|
|
|||
Loading…
Reference in a new issue