-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Typography 수정 * GNB 기본 설정 * Colors 설정 * Color 추가 * BaseColor 이름 변경
- Loading branch information
Showing
20 changed files
with
351 additions
and
290 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,3 @@ | ||
{ | ||
"processors": ["stylelint-processor-styled-components"], | ||
"extends": [ | ||
"stylelint-config-standard", | ||
"stylelint-config-styled-components" | ||
], | ||
"syntax": "scss", | ||
"rules": { | ||
"selector-type-case": null, | ||
"comment-empty-line-before": null, | ||
"declaration-empty-line-before": null, | ||
"selector-type-no-unknown": [true, { | ||
"ignore": ["custom-elements", "default-namespace"] | ||
}], | ||
"no-eol-whitespace": [true, { | ||
"ignore": ["empty-lines"] | ||
}] | ||
} | ||
"extends": ["@channel.io/stylelint-config"] | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
/* External dependencies */ | ||
import styled from 'styled-components' | ||
|
||
const Text = styled.span` | ||
font-size: ${props => props.theme?.typo?.normal ?? 13}px; | ||
color: ${props => props.theme?.palette?.black70}; | ||
/* Internal dependencies */ | ||
import TextProps from './Text.types' | ||
|
||
const Text = styled.span<TextProps>` | ||
${props => props.typo}; | ||
color: ${props => props.theme?.colors?.textBase ?? 'black'}; | ||
` | ||
|
||
export default Text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
/* External dependencies */ | ||
import { css } from 'styled-components' | ||
|
||
/* Internal dependencies */ | ||
import { ContentComponentProps } from '../../types/ComponentProps' | ||
|
||
export default interface TextProps extends ContentComponentProps<string> {} | ||
export default interface TextProps extends ContentComponentProps<string> { | ||
typo?: ReturnType<typeof css> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* External dependencies */ | ||
import React from 'react' | ||
import { withKnobs } from '@storybook/addon-knobs' | ||
|
||
/* Internal dependencies */ | ||
import { LightTheme, ThemeProvider } from '../../styling/Theme' | ||
import GNB from './GNB' | ||
|
||
export default { | ||
title: 'GNB', | ||
decorators: [withKnobs], | ||
} | ||
|
||
export const WithoutTheme = () => (<GNB />) | ||
|
||
export const WithTheme = () => ( | ||
<ThemeProvider theme={LightTheme}> | ||
<GNB /> | ||
</ThemeProvider> | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* External dependencies */ | ||
import styled from 'styled-components' | ||
|
||
/* Internal dependencies */ | ||
import GNBProps from './GNB.types' | ||
|
||
const GNB = styled.div<GNBProps>` | ||
position: absolute; | ||
top: 0; | ||
bottom: 0; | ||
left: 0; | ||
z-index: 10000; | ||
display: flex; | ||
align-items: center; | ||
flex-direction: column; | ||
width: 68px; | ||
height: 100%; | ||
background-color: ${props => props.theme?.colors?.background2}; | ||
` | ||
|
||
export default GNB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* External dependencies */ | ||
import React from 'react' | ||
|
||
/* Internal dependencies */ | ||
import GNBView from './GNB.styled' | ||
import GNBProps from './GNB.types' | ||
|
||
function GNB({ | ||
children, | ||
}: GNBProps) { | ||
return ( | ||
<GNBView> | ||
{ children } | ||
</GNBView> | ||
) | ||
} | ||
|
||
export default GNB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/* Internal dependencies */ | ||
import { ChildrenComponentProps } from '../../types/ComponentProps' | ||
|
||
export default interface GNBProps extends ChildrenComponentProps {} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* Internal dependencies */ | ||
import Palette from './Palette' | ||
|
||
export interface Colors { | ||
textBase?: string | ||
|
||
// Backgrounds | ||
background2?: string | ||
background1?: string | ||
} | ||
|
||
export const Light: Colors = { | ||
textBase: Palette.grey900, | ||
background2: Palette.grey200, | ||
background1: Palette.grey100, | ||
} | ||
|
||
export const Dark: Colors = { | ||
textBase: Palette.grey100, | ||
background2: Palette.grey900, | ||
background1: Palette.grey700, | ||
} | ||
|
||
const LIGHT_KEYWORD = 'light' | ||
const DARK_KEYWORD = 'dark' | ||
|
||
interface createColorsConfig { | ||
colors: Partial<Colors> | ||
base?: string | ||
} | ||
|
||
function getColorsFromKeyword(keyword: string) { | ||
switch (keyword) { | ||
case DARK_KEYWORD: | ||
return Dark | ||
case LIGHT_KEYWORD: | ||
default: | ||
return Light | ||
} | ||
} | ||
|
||
export function createColors({ | ||
colors, | ||
base = 'light', | ||
}: createColorsConfig): Colors { | ||
return { | ||
...getColorsFromKeyword(base), | ||
...colors, | ||
} | ||
} | ||
|
||
export default { | ||
Light, | ||
Dark, | ||
} |
Oops, something went wrong.