slate/common/styles.js

291 lines
5.9 KiB
JavaScript
Raw Normal View History

2021-05-06 03:08:14 +03:00
import * as Constants from "~/common/constants";
import { css } from "@emotion/react";
/* TYPOGRAPHY */
export const OVERFLOW_ELLIPSIS = css`
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
`;
2021-07-07 23:50:57 +03:00
export const LINK = css`
text-decoration: none;
color: ${Constants.semantic.textBlack};
2021-07-07 23:50:57 +03:00
cursor: pointer;
:visited {
color: ${Constants.semantic.textBlack};
2021-07-07 23:50:57 +03:00
}
`;
const TEXT = css`
box-sizing: border-box;
overflow-wrap: break-word;
2021-08-04 22:06:38 +03:00
text-align: left;
font-weight: normal;
2021-07-07 23:50:57 +03:00
a {
${LINK}
}
`;
export const H1 = css`
font-family: ${Constants.font.medium};
2021-11-12 01:28:15 +03:00
font-size: 32px;
line-height: 48px;
2021-07-07 23:50:57 +03:00
letter-spacing: -0.021px;
${TEXT}
2021-05-06 03:08:14 +03:00
`;
2021-07-07 23:50:57 +03:00
export const H2 = css`
font-family: ${Constants.font.medium};
2021-11-12 01:28:15 +03:00
font-size: 24px;
line-height: 36px;
2021-07-07 23:50:57 +03:00
letter-spacing: -0.019px;
${TEXT}
2021-05-06 03:08:14 +03:00
`;
2021-07-07 23:50:57 +03:00
export const H3 = css`
font-family: ${Constants.font.medium};
2021-11-12 01:28:15 +03:00
font-size: 20px;
line-height: 28px;
2021-07-07 23:50:57 +03:00
letter-spacing: -0.017px;
${TEXT}
2021-05-06 03:08:14 +03:00
`;
2021-07-07 23:50:57 +03:00
export const H4 = css`
font-family: ${Constants.font.medium};
2021-11-12 01:28:15 +03:00
font-size: 16px;
line-height: 24px;
2021-07-07 23:50:57 +03:00
letter-spacing: -0.011px;
${TEXT}
2021-05-06 03:08:14 +03:00
`;
2021-07-07 23:50:57 +03:00
export const H5 = css`
font-family: ${Constants.font.medium};
2021-11-12 01:28:15 +03:00
font-size: 14px;
line-height: 20px;
2021-07-07 23:50:57 +03:00
letter-spacing: -0.006px;
${TEXT}
2021-05-06 03:08:14 +03:00
`;
2021-09-24 19:38:48 +03:00
export const H6 = css`
font-family: ${Constants.font.medium};
2021-11-12 01:28:15 +03:00
font-size: 12px;
line-height: 20px;
2021-09-24 19:38:48 +03:00
letter-spacing: -0.01px;
${TEXT}
`;
2021-07-07 23:50:57 +03:00
export const P1 = css`
2021-05-06 03:08:14 +03:00
font-family: ${Constants.font.text};
2021-11-12 01:28:15 +03:00
font-size: 16px;
line-height: 24px;
2021-07-07 23:50:57 +03:00
letter-spacing: -0.011px;
2021-05-27 11:20:34 +03:00
@media (max-width: ${Constants.sizes.mobile}px) {
font-family: ${Constants.font.text};
2021-11-12 01:28:15 +03:00
font-size: 14px;
line-height: 20px;
2021-05-27 11:20:34 +03:00
letter-spacing: -0.006px;
}
2021-07-07 23:50:57 +03:00
${TEXT}
2021-05-06 03:08:14 +03:00
`;
2021-07-07 23:50:57 +03:00
export const P2 = css`
2021-05-06 03:08:14 +03:00
font-family: ${Constants.font.text};
2021-11-12 01:28:15 +03:00
font-size: 14px;
line-height: 20px;
2021-07-07 23:50:57 +03:00
letter-spacing: -0.006px;
${TEXT}
2021-05-06 03:08:14 +03:00
`;
2021-07-07 23:50:57 +03:00
export const P3 = css`
2021-05-06 03:08:14 +03:00
font-family: ${Constants.font.text};
2021-11-12 01:28:15 +03:00
font-size: 12px;
line-height: 16px;
2021-07-07 23:50:57 +03:00
letter-spacing: 0px;
${TEXT}
2021-05-06 03:08:14 +03:00
`;
2021-07-07 23:50:57 +03:00
export const C1 = css`
2021-05-06 03:08:14 +03:00
font-family: ${Constants.font.code};
2021-11-12 01:28:15 +03:00
font-size: 16px;
line-height: 24px;
@media (max-width: ${Constants.sizes.mobile}px) {
font-size: 14px;
line-height: 20px;
}
2021-07-07 23:50:57 +03:00
${TEXT}
2021-05-06 03:08:14 +03:00
`;
2021-07-07 23:50:57 +03:00
export const C2 = css`
2021-05-06 03:08:14 +03:00
font-family: ${Constants.font.code};
2021-11-12 01:28:15 +03:00
font-size: 14px;
line-height: 20px;
2021-07-07 23:50:57 +03:00
${TEXT}
`;
export const C3 = css`
font-family: ${Constants.font.code};
2021-11-12 01:28:15 +03:00
font-size: 12px;
line-height: 16px;
2021-07-07 23:50:57 +03:00
${TEXT}
`;
export const B1 = css`
font-family: ${Constants.font.medium};
2021-07-07 23:50:57 +03:00
font-size: 0.875rem;
line-height: 1;
letter-spacing: -0.006px;
${TEXT}
2021-05-06 03:08:14 +03:00
`;
/* FREQUENTLY USED */
export const HORIZONTAL_CONTAINER = css`
display: flex;
flex-direction: row;
`;
export const VERTICAL_CONTAINER = css`
display: flex;
flex-direction: column;
`;
export const HORIZONTAL_CONTAINER_CENTERED = css`
display: flex;
flex-direction: row;
align-items: center;
`;
export const VERTICAL_CONTAINER_CENTERED = css`
display: flex;
flex-direction: column;
align-items: center;
`;
export const CONTAINER_CENTERED = css`
display: flex;
align-items: center;
justify-content: center;
`;
export const ICON_CONTAINER = css`
display: flex;
align-items: center;
justify-content: center;
padding: 4px;
margin: -4px;
cursor: pointer;
color: ${Constants.system.black};
:hover {
2021-11-12 01:28:15 +03:00
color: ${Constants.semantic.textGrayDark};
2021-05-06 03:08:14 +03:00
}
`;
export const HOVERABLE = css`
cursor: pointer;
:hover {
2021-11-12 01:28:15 +03:00
color: ${Constants.semantic.textGrayDark};
2021-05-06 03:08:14 +03:00
}
`;
export const MOBILE_HIDDEN = css`
@media (max-width: ${Constants.sizes.mobile}px) {
display: none;
pointer-events: none;
}
`;
export const MOBILE_ONLY = css`
@media (min-width: ${Constants.sizes.mobile}px) {
display: none;
pointer-events: none;
}
`;
//NOTE(martina): resize so the image is fills its container from edge to edge, while maintaining aspect ratio. Any overflow is clipped
export const IMAGE_FILL = css`
width: 100%;
height: 100%;
object-fit: cover;
`;
//NOTE(martina): resize so the image is contained within the bounds of its container, while maintaining aspect ratio. There is no overflow
export const IMAGE_FIT = css`
width: 100%;
height: 100%;
object-fit: contain;
`;
2021-05-27 11:20:34 +03:00
/* COMMON GRIDS */
export const OBJECTS_PREVIEW_GRID = (theme) => css`
2021-05-27 11:20:34 +03:00
display: grid;
grid-template-columns: repeat(auto-fill, minmax(${theme.grids.object.desktop.width}px, 1fr));
grid-gap: 24px ${theme.grids.object.desktop.rowGap}px;
2021-05-27 11:20:34 +03:00
@media (max-width: ${Constants.sizes.mobile}px) {
grid-gap: 20px ${theme.grids.object.mobile.rowGap}px;
grid-template-columns: repeat(auto-fill, minmax(${theme.grids.object.mobile.width}px, 1fr));
2021-05-27 11:20:34 +03:00
}
`;
export const BUTTON_RESET = css`
padding: 0;
margin: 0;
background-color: unset;
border: none;
cursor: pointer;
2021-05-27 11:20:34 +03:00
${HOVERABLE}
`;
export const COLLECTIONS_PREVIEW_GRID = (theme) => css`
2021-05-27 11:20:34 +03:00
display: grid;
grid-template-columns: repeat(auto-fill, minmax(${theme.grids.collection.desktop.width}px, 1fr));
grid-gap: 24px ${theme.grids.collection.desktop.rowGap}px;
2021-05-27 11:20:34 +03:00
@media (max-width: ${Constants.sizes.desktop}px) {
grid-gap: 20px ${theme.grids.collection.mobile.rowGap}px;
grid-template-columns: repeat(auto-fill, minmax(${theme.grids.collection.mobile.width}px, 1fr));
2021-05-27 11:20:34 +03:00
}
`;
export const PROFILE_PREVIEW_GRID = (theme) => css`
2021-05-27 11:20:34 +03:00
display: grid;
grid-template-columns: repeat(auto-fill, minmax(${theme.grids.profile.desktop.width}px, 1fr));
grid-gap: 24px ${theme.grids.profile.desktop.rowGap}px;
2021-05-27 11:20:34 +03:00
@media (max-width: ${Constants.sizes.mobile}px) {
grid-gap: 20px ${theme.grids.profile.mobile.rowGap}px;
grid-template-columns: repeat(auto-fill, minmax(${theme.grids.profile.mobile.width}px, 1fr));
2021-05-27 11:20:34 +03:00
}
`;
export const PAGE_CONTENT_WRAPPER = (theme) => css`
width: 100%;
min-height: calc(100vh - ${theme.sizes.filterNavbar}px) - ${theme.sizes.header}px;
padding: 20px 20px 44px;
@media (max-width: ${theme.sizes.mobile}px) {
padding: 16px 16px 44px;
}
`;