-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed font issues + glass effects + typos
- Loading branch information
Showing
12 changed files
with
368 additions
and
93 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<link | ||
href="https://fonts.googleapis.com/css2?family=Public+Sans:ital,wght@0,400;1,400;1,700&family=Source+Code+Pro:wght@400;700&family=Rubik:ital,wght@0,500;1,800&display=swap" | ||
rel="stylesheet"> |
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import React from "react"; | ||
import { ComponentStory, ComponentMeta } from "@storybook/react"; | ||
import { withDesign } from 'storybook-addon-designs' | ||
import { StoryBookHeader, StoryBookSubheader } from "./utils"; | ||
|
||
export default { | ||
title: "Design/Atoms/Typography", | ||
decorators: [withDesign], | ||
} as ComponentMeta<any>; | ||
|
||
const defaultArgs: Partial<any> = { | ||
} | ||
|
||
const defaultParams = { | ||
design: { | ||
type: 'figma', | ||
url: 'https://www.figma.com/file/OXq1C8cPtY3JtmwmGfD23I/ALEPH-rebranding-UIKIT?node-id=1%3A276&t=OG6V4eRdvQIurCbK-0', | ||
}, | ||
} | ||
|
||
// --- | ||
|
||
const TypographyTemplate: ComponentStory<any> = (args) => { | ||
return ( | ||
<> | ||
<StoryBookHeader>Typography</StoryBookHeader> | ||
<div> | ||
<StoryBookSubheader>Headers</StoryBookSubheader> | ||
<h1>H1 - Rubik - headers</h1> | ||
<h2>H2 - Rubik - headers</h2> | ||
<h3>H3 - Rubik - headers</h3> | ||
<h4>H4 - Rubik - headers</h4> | ||
<h5>H5 - Rubik - headers</h5> | ||
<h6>H6 - Rubik - headers</h6> | ||
<span className="typ-h7">H7 - Rubik - headers</span> | ||
</div> | ||
</> | ||
) | ||
}; | ||
|
||
export const Typography = TypographyTemplate.bind({}) | ||
Typography.args = { | ||
...defaultArgs | ||
}; | ||
Typography.parameters = { | ||
...defaultParams, | ||
controls: { include: [], hideNoControlsWarning: true } | ||
} |
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 @@ | ||
import styled from "styled-components"; | ||
|
||
export const StoryBookHeader = styled.h1` | ||
display: inline-block; | ||
font-family: 'Public Sans'; | ||
font-style: italic; | ||
font-weight: 800; | ||
font-size: 132px; | ||
line-height: 155px; | ||
color: #FFFFFF; | ||
border-bottom: 2px solid white; | ||
` | ||
|
||
export const StoryBookSubheader = styled.h2` | ||
font-family: 'Rubik'; | ||
font-style: italic; | ||
font-weight: 600; | ||
font-size: 48px; | ||
line-height: 57px; | ||
` |
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,128 @@ | ||
import { css, FlattenInterpolation } from "styled-components" | ||
import { ThemeDarkEffect, ThemeGlassEffect } from "../themes/styles" | ||
import { calculateBoxShadowPossition } from './glow' | ||
|
||
export type GlassOpts = { width?: number, height?: number, offset?: boolean } | ||
|
||
export function getGlassEffectCss(color: keyof ThemeGlassEffect, opts?: GlassOpts): FlattenInterpolation<any> | undefined { | ||
return css` | ||
${({ theme }) => { | ||
if (color === 'main0' || color === 'main1' || color === 'main2') { | ||
// inset 0 -82px 68px -64px #494DA966, | ||
// inset 0 7px 11px -4px #FFFFFFE5, | ||
// inset 0 39px 56px -36px #FFFFFF66, | ||
// inset 0 1px 40px 0px #DEEFFF1A, | ||
// inset 0 4px 18px 0px #5E9DD766, | ||
// inset 0 98px 100px -48px #00D1FF2E; | ||
const bs = { | ||
s1: [0, -0.4271, 0.3542, -0.3333], | ||
s2: [0, 0.0365, 0.0573, -0.0208], | ||
s3: [0, 0.2031, 0.2917, -0.1875], | ||
s4: [0, 0.0052, 0.2083, 0], | ||
s5: [0, 0.0208, 0.0938, 0], | ||
s6: [0, 0.5104, 0.5208, -0.25] | ||
} | ||
const bss = calculateBoxShadowPossition(bs, opts) | ||
const c = theme.gradient[color].colors | ||
const bg = `background-image: linear-gradient(90deg, ${c[0]}03 0%, ${c[1]}03 100%);` | ||
switch (color) { | ||
case 'main0': | ||
return ` | ||
${bg} | ||
box-shadow: | ||
inset ${bss.s1} #494DA966, | ||
inset ${bss.s2} #FFFFFFE5, | ||
inset ${bss.s3} #FFFFFF66, | ||
inset ${bss.s4} #DEEFFF1A, | ||
inset ${bss.s5} #5E9DD766, | ||
inset ${bss.s6} #00D1FF2E; | ||
` | ||
case 'main1': | ||
return ` | ||
${bg} | ||
box-shadow: | ||
inset ${bss.s1} #4462904D, | ||
inset ${bss.s2} #FFFFFF, | ||
inset ${bss.s3} #FFFFFF80, | ||
inset ${bss.s4} #DEFFF533, | ||
inset ${bss.s5} #92D2AF4D, | ||
inset ${bss.s6} #00FFBD2E; | ||
` | ||
case 'main2': | ||
return ` | ||
${bg} | ||
box-shadow: | ||
inset ${bss.s1} #FF5C0017, | ||
inset ${bss.s2} #FFFFFF, | ||
inset ${bss.s3} #FFFFFF80, | ||
inset ${bss.s4} #FFFCDE33, | ||
inset ${bss.s5} #805B234D, | ||
inset ${bss.s6} #F3FFC11A; | ||
` | ||
} | ||
} else { | ||
switch (color) { | ||
case 'base0': | ||
return ` | ||
border: 1px solid #FFFFFF1A; | ||
background-image: | ||
linear-gradient(91.23deg, #FFFFFF11 11.38%, #FFFFFF00 96.5%), | ||
linear-gradient(84.86deg, #2260FF0C 65.23%, #1859FF00 99.89%), | ||
linear-gradient(0deg, ${theme.color.background}, ${theme.color.background}); | ||
` | ||
case 'base1': | ||
return ` | ||
background-image: | ||
linear-gradient(90.96deg, #1D1C3780 54.81%, #1D1C3700 103.58%); | ||
` | ||
case 'base2': | ||
const bs = { | ||
s1: [0, 0.0052, 0.2083, 0], | ||
s2: [0, 0.0208, 0.0938, 0] | ||
} | ||
const bss = calculateBoxShadowPossition(bs, opts) | ||
return ` | ||
background: ${theme.color.main0}03; | ||
box-shadow: | ||
inset ${bss.s1} #DEEFFF05, | ||
inset ${bss.s2} #5E9DD705; | ||
` | ||
case 'colored0': | ||
const c = theme.gradient.main0.colors | ||
return ` | ||
border: 1px solid #FFFFFF1A; | ||
background: | ||
linear-gradient(91.23deg, #FFFFFF11 11.38%, #FFFFFF00 96.5%), | ||
linear-gradient(342.74deg, #2D113A66 22.13%, #43125900 67.01%), | ||
linear-gradient(107.53deg, ${c[0]}4D 16.25%, ${c[1]}4D 82.42%), | ||
linear-gradient(0deg, ${theme.color.background}, ${theme.color.background}); | ||
` | ||
} | ||
} | ||
}} | ||
` | ||
} | ||
|
||
export function getDarkEffectCss(color: keyof ThemeDarkEffect, opts?: GlassOpts): FlattenInterpolation<any> | undefined { | ||
const bs = { | ||
s1: [0, 0.0052, 0.2604, 0] | ||
} | ||
|
||
const bss = calculateBoxShadowPossition(bs, opts) | ||
|
||
return css` | ||
${({ theme }) => { | ||
return ` | ||
background-color: ${theme.color.main0}03; | ||
box-shadow: ${bss.s1} #00000080; | ||
` | ||
}} | ||
` | ||
} |
Oops, something went wrong.