Skip to content

v2.0.0-beta.170

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 30 Aug 07:42
· 626 commits to beta since this release

New Features

Vue
  • Register the theme service using ThemeServiceProvider f4dfaca @BenSeage

    <script setup lang="ts">
    import { CSSProvider, ThemeServiceProvider } from '@master/css.vue'
    import config from '../master.css'
    import HelloWorld from "./components/HelloWorld.vue";
    </script>
    
    <template>
        <CSSProvider :config="config">
            <ThemeServiceProvider :options="{ default: 'system' }">
                <HelloWorld />
            </ThemeServiceProvider>
        </CSSProvider>
    </template>

    and access the theme context:

    <script setup lang="ts">
    import { ref, inject } from 'vue'
    
    const count = ref<number>(0)
    const themeService = inject<any>('theme-service')
    
    function changeTheme(event: any) {
        themeService.switch(event.target.value)
    }
    </script>

Documentation