Skip to content

Commit

Permalink
feat(style): refine entire component styles (#191)
Browse files Browse the repository at this point in the history
Co-authored-by: Suyeon Woo <[email protected]>
Co-authored-by: Suyeon Woo <[email protected]>
Co-authored-by: Yerin Park <[email protected]>
Co-authored-by: 박예린 <[email protected]>
  • Loading branch information
5 people authored Jun 3, 2024
1 parent 90cd693 commit 3d62374
Show file tree
Hide file tree
Showing 211 changed files with 3,204 additions and 1,389 deletions.
2 changes: 2 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/vlossom/.storybook-chromatic/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function getAbsolutePath(value: string): any {
}

const config: StorybookConfig = {
stories: ['../src/**/*.chromatic.stories.@(js|jsx|mjs|ts|tsx)'],
stories: ['./../src/**/*.chromatic.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
getAbsolutePath('@storybook/addon-links'),
getAbsolutePath('@storybook/addon-essentials'),
Expand Down
2 changes: 1 addition & 1 deletion packages/vlossom/.storybook-chromatic/preview.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { setup } from '@storybook/vue3';
import { createVlossom, useVlossom } from '../src';
import { createVlossom, useVlossom } from './../src';
import './../src/styles/index.scss';

import type { Preview } from '@storybook/vue3';
Expand Down
2 changes: 1 addition & 1 deletion packages/vlossom/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function getAbsolutePath(value: string): any {
}

const config: StorybookConfig = {
stories: ['../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
stories: ['./../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
getAbsolutePath('@storybook/addon-links'),
getAbsolutePath('@storybook/addon-essentials'),
Expand Down
4 changes: 2 additions & 2 deletions packages/vlossom/.storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { setup } from '@storybook/vue3';
import { createVlossom, useVlossom } from '../src';
import { styleSet } from '../src/storybook/style-sets';
import { createVlossom, useVlossom } from './../src';
import { styleSet } from './../src/storybook/style-sets';
import './../src/styles/index.scss';

import type { Preview } from '@storybook/vue3';
Expand Down
65 changes: 60 additions & 5 deletions packages/vlossom/playground/Playground.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,71 @@
<template>
<vs-page>
<template #title>Vlossom Playground</template>
<vs-layout>
<vs-header
class="header"
position="fixed"
primary
height="60px"
:style-set="{ backgroundColor: 'black', fontColor: 'white' }"
>
<div class="logo">
<vs-image src="/assets/vlossom-logo.png" :style-set="{ height: '40px', width: '40px' }" />
<span>Vlossom</span>
</div>
<vs-theme-button />
</vs-header>

Hello Vlossom!
</vs-page>
<vs-container>
<vs-page>
<template #title>Vlossom Playground</template>

<vs-section>
<template #title>Hello Vlossom!</template>

Vlossom is a Vue 3 component library that provides a set of high-quality components and themes for
your Vue 3 applications.
</vs-section>
</vs-page>
</vs-container>

<vs-footer
class="footer"
:style-set="{ backgroundColor: 'black', fontColor: '#dfdfdf' }"
height="30px"
position="fixed"
>
<span>&copy; {{ currentYear }} Vlossom</span>
</vs-footer>
</vs-layout>
</template>

<script lang="ts">
export default {
name: 'Playground',
setup() {
return {};
const currentYear = new Date().getFullYear();
return { currentYear };
},
};
</script>

<style lang="scss" scoped>
.header {
display: flex;
justify-content: space-between;
.logo {
display: flex;
align-items: center;
span {
font-size: 1.5rem;
font-weight: bold;
margin-left: 10px;
}
}
}
.footer {
font-size: 12px;
}
</style>
2 changes: 1 addition & 1 deletion packages/vlossom/playground/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createApp } from 'vue';
import { createVlossom } from '../src';
import { createVlossom } from './../src';
import Playground from './Playground.vue';

const app = createApp(Playground);
Expand Down
14 changes: 9 additions & 5 deletions packages/vlossom/src/components/vs-accordion/VsAccordion.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
$titleColor: var(--vs-accordion-titleFontColor, var(--vs-comp-color));
$titleColor: var(--vs-accordion-titleFontColor, var(--vs-comp-font));

.vs-accordion {
position: relative;

details {
box-sizing: border-box;
overflow: hidden;
border: var(--vs-accordion-border, 1px solid $titleColor);
border-radius: var(--vs-accordion-borderRadius, 0.4rem);
border: var(--vs-accordion-border, 1px solid var(--vs-line-color));
border-radius: var(--vs-accordion-borderRadius, calc(var(--vs-radius-ratio) * 0.4rem));

summary {
position: relative;
Expand All @@ -16,7 +16,7 @@ $titleColor: var(--vs-accordion-titleFontColor, var(--vs-comp-color));
font-size: var(--vs-accordion-titleFontSize, 1rem);
font-weight: var(--vs-accordion-titleFontWeight, 600);
color: $titleColor;
background-color: var(--vs-accordion-titleBackgroundColor, var(--vs-comp-backgroundColor));
background-color: var(--vs-accordion-titleBackgroundColor, var(--vs-comp-bg));
padding: var(--vs-accordion-titlePadding, 1rem);
padding-left: 2.2rem;
cursor: pointer;
Expand All @@ -39,8 +39,8 @@ $titleColor: var(--vs-accordion-titleFontColor, var(--vs-comp-color));

.accordion-content {
box-sizing: border-box;
background-color: var(--vs-accordion-contentBackgroundColor, var(--vs-no-color));
color: var(--vs-accordion-contentFontColor, var(--vs-font-color));
background-color: var(--vs-accordion-contentBackgroundColor, var(--vs-plain-backgroundColor));
padding: var(--vs-accordion-contentPadding, 0.8rem 1.6rem);
}
}
Expand All @@ -52,4 +52,8 @@ $titleColor: var(--vs-accordion-titleFontColor, var(--vs-comp-color));
details[open] > summary:before {
transform: translateY(-50%) rotate(90deg);
}

details[open] > summary {
border-bottom: 1px solid var(--vs-line-color);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,17 @@ const meta: Meta<typeof VsAccordion> = {
return { args };
},
template: `
<vs-accordion v-bind="args">
<div>
<vs-accordion v-bind="args" :style="{ marginBottom: '12px' }">
<template #title>Hello, Chromatic Vlossom!</template>
${LOREM_IPSUM}
</vs-accordion>`,
</vs-accordion>
<vs-accordion v-bind="args" open>
<template #title>Hello, Chromatic Vlossom!</template>
${LOREM_IPSUM}
</vs-accordion>
</div>`,
}),
tags: ['autodocs'],
argTypes: {
colorScheme,
},
Expand Down
7 changes: 4 additions & 3 deletions packages/vlossom/src/components/vs-avatar/VsAvatar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
display: inline-flex;
justify-content: center;
align-items: center;
border-radius: var(--vs-avatar-borderRadius, 0.4rem);
border: var(--vs-avatar-border, 0.1rem solid var(--vs-line-color));
border-radius: var(--vs-avatar-borderRadius, calc(var(--vs-radius-ratio) * 0.4rem));
width: var(--vs-avatar-width, 3rem);
height: var(--vs-avatar-height, 3rem);
background-color: var(--vs-avatar-backgroundColor, var(--vs-comp-backgroundColor));
color: var(--vs-avatar-fontColor, var(--vs-comp-color));
background-color: var(--vs-avatar-backgroundColor, var(--vs-comp-bg));
color: var(--vs-avatar-fontColor, var(--vs-comp-font));
font-size: var(--vs-avatar-fontSize, 0.8rem);
font-weight: var(--vs-avatar-fontWeight, 400);
overflow: hidden;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { colorScheme } from '@/storybook';
import VsAvatar from './../VsAvatar.vue';

import type { Meta, StoryObj } from '@storybook/vue3';

const meta: Meta<typeof VsAvatar> = {
title: 'Chromatic/Base Components/VsAvatar',
component: VsAvatar,
render: (args: any) => ({
components: { VsAvatar },
setup() {
return { args };
},
template: `
<div style="display:flex; align-items:center;">
<vs-avatar v-bind="args">VS</vs-avatar>
<vs-avatar v-bind="args">
<img src="https://upload.wikimedia.org/wikipedia/en/a/a6/Pok%C3%A9mon_Pikachu_art.png" alt="pikachu">
</vs-avatar>
</div>`,
}),
argTypes: {
colorScheme,
},
};

export default meta;
type Story = StoryObj<typeof VsAvatar>;

export const Default: Story = {};
12 changes: 6 additions & 6 deletions packages/vlossom/src/components/vs-block/VsBlock.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ $borderColor: var(--vs-block-borderColor, var(--vs-line-color));
width: 100%;
overflow: auto;
border: var(--vs-block-border, $borderWidth $borderStyle $borderColor);
border-radius: var(--vs-block-borderRadius, 0.4rem);
border-radius: var(--vs-block-borderRadius, calc(var(--vs-radius-ratio) * 0.5rem));

.block-header {
background-color: var(--vs-block-headerBackgroundColor, var(--vs-comp-backgroundColor));
background-color: var(--vs-block-headerBackgroundColor, var(--vs-comp-bg));
border-bottom: $borderWidth $borderStyle $borderColor;
color: var(--vs-block-headerFontColor, var(--vs-comp-color));
color: var(--vs-block-headerFontColor, var(--vs-comp-font));
font-weight: var(--vs-block-headerFontWeight, 500);
padding: var(--vs-block-headerPadding, 0.8rem 2rem);
padding: var(--vs-block-headerPadding, 1rem 1.2rem);
position: relative;
width: 100%;
}

.block-content {
background-color: var(--vs-block-backgroundColor, var(--vs-plain-backgroundColor));
background-color: var(--vs-block-backgroundColor, var(--vs-no-color));
color: var(--vs-block-contentFontColor, var(--vs-font-color));
font-weight: var(--vs-block-fontWeight, 400);
padding: var(--vs-block-padding, 1.6rem 2rem);
padding: var(--vs-block-padding, 1rem 1.2rem);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { colorScheme } from '@/storybook';
import VsBlock from './../VsBlock.vue';

import type { Meta, StoryObj } from '@storybook/vue3';

const meta: Meta<typeof VsBlock> = {
title: 'Chromatic/Layout Components/VsBlock',
component: VsBlock,
render: (args: any) => ({
components: { VsBlock },
setup() {
return { args };
},
template: `
<div>
<vs-block v-bind="args":style="{ marginBottom: '12px' }">This is block content</vs-block>
<vs-block v-bind="args":style="{ marginBottom: '12px' }">
<template #title>This is block title</template>
This is block content
</vs-block>
</div>`,
}),
argTypes: {
colorScheme,
},
};

export default meta;
type Story = StoryObj<typeof VsBlock>;

export const Default: Story = {};
Loading

0 comments on commit 3d62374

Please sign in to comment.