Skip to content

Commit

Permalink
type updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mrksbnc committed Nov 18, 2023
1 parent 316d717 commit cd5903a
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/components/Icon/BoIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</template>

<script setup lang="ts">
import type { OptionalCss } from '@/types';
import type { CssStyle, OptionalCss } from '@/types';
import type { Icon } from '@/components/Icon';
import { iconMap, IconSize } from '@/components/Icon';
import {
Expand Down Expand Up @@ -39,10 +39,10 @@ const props = defineProps({
const { name, size, color } = toRefs(props);
const index = ref<number>(0);
const id = ref<string>(`bo-icon-${index.value + 1}`);
const icon = ref<{ default: string } | null>(null);
const id = ref<string>(`bo-icon-${index.value + 1}`);
const style = computed<Record<string, string>>(() => {
const style = computed<CssStyle>(() => {
const i = iconMap.get(name.value) ?? null;
const defaultColor = 'var(--icon-color)';
Expand Down Expand Up @@ -83,11 +83,11 @@ const boIconClass = computed<OptionalCss>(() => {
return classes;
});
onBeforeMount(() => {
onBeforeMount((): void => {
icon.value = iconMap.get(name.value) ?? null;
});
onUpdated(() => {
onUpdated((): void => {
icon.value = iconMap.get(name.value) ?? null;
});
</script>
Expand Down
18 changes: 18 additions & 0 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1 +1,19 @@
@import './themes.scss';

:root {
font-family:
ui-sans-serif,
system-ui,
-apple-system,
BlinkMacSystemFont,
'Segoe UI',
Roboto,
'Helvetica Neue',
Arial,
'Noto Sans',
sans-serif,
'Apple Color Emoji',
'Segoe UI Emoji',
'Segoe UI Symbol',
'Noto Color Emoji';
}
2 changes: 2 additions & 0 deletions src/types/css.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export declare type OptionalCss = Record<string, boolean>;

export declare type CssStyle = Record<string, string>;
2 changes: 1 addition & 1 deletion src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export type { OptionalCss } from './css';
export type { CssStyle, OptionalCss } from './css';

0 comments on commit cd5903a

Please sign in to comment.