Skip to content

Instantly share code, notes, and snippets.

View koss-lebedev's full-sized avatar

Konstantin koss-lebedev

View GitHub Profile
import styled from 'styled-components'
const Header = styled.h1`
font-size: ${props => props.theme.fontSize.header};
color: ${props => props.theme.color.text};
`;
const theme = {
color: {
text: '#141414',
primary: '#023EBE',
danger: '#E90056'
},
fontSize: {
header: '2rem',
subTitle: '1.8rem',
text: '1.6rem'
import styled from 'styled-components'
import theme from 'styles'
const Header = styled.h1`
font-size: ${theme.fontSize.header};
color: ${theme.color.text};
`;
import styled from 'styled-components'
const Header = styled.h1`
font-size: ${props => props.theme.fontSize.header};
color: ${props => props.theme.colors.text};
`;
import styled from 'styled-components'
import theme from 'styles'
const Header = styled.h1`
font-size: ${theme.fontSize.header};
color: ${theme.colors.text};
`;
// [ts] property 'colors' doesn't exist. Did you mean `color`?
import theme from 'styles'
export const Container = styled.div`
box-shadow: inset 0 6.2rem 0 0 ${theme.color.lightBackground};
border: 0.1rem solid ${theme.color.border};
border-radius: ${theme.borderRadius};
`
export const Container = styled.div`
box-shadow: inset 0 6.2rem 0 0 ${props => props.theme.color.lightBackground};
border: 0.1rem solid ${props => props.theme.color.border};
border-radius: ${props => props.theme.borderRadius};
`
interface IUser {
firstName: string
lastName: string
}
interface IUser {
age: number
}
const user: IUser = {
type CreditCard = {
number: string
expMonth: number
expYear: number
}
// Type with union operator
type Chargeable = { token: string } | { cvc: number }
type ChargeableCreditCard = CreditCard & Chargeable
rails generate active_dynamic
rake db:migrate