UNPKG

@crossed/ui

Version:

A universal & performant styling library for React Native, Next.js & React

118 lines (117 loc) 2.97 kB
import { createStyles } from "@crossed/styled"; const indicatorUnderlineStyles = createStyles(({ colors }) => ({ active: { base: { borderBottomColor: colors.border.brand } }, default: { base: { borderBottomWidth: 4, height: 4, borderBottomColor: "transparent", borderRadius: 4, position: "absolute", bottom: 0 } } })); const linearGradientRounded = createStyles(({ colors }) => ({ prev: { base: { left: 0, background: `linear-gradient(to right, ${colors.background.primary} 70%, transparent)` } }, next: { base: { right: 0, background: `linear-gradient(to left, ${colors.background.primary} 70%, transparent)` } } })); const linearGradientUnderline = createStyles(({ colors }) => ({ prev: { base: { left: 0, background: `linear-gradient(to right, ${colors.background.secondary} 70%, transparent)` } }, next: { base: { right: 0, background: `linear-gradient(to left, ${colors.background.secondary} 70%, transparent)` } } })); const indicatorRoundedStyles = createStyles(({ colors }) => ({ active: { base: { backgroundColor: colors.background.secondary } }, default: { base: { backgroundColor: "transparent", borderRadius: 24, position: "absolute" }, web: { base: { boxShadow: "0px 1px 4px 0px #1018280A" } } } })); const indicatorDynamicStyles = createStyles(() => ({ dyn: (left, width) => ({ width, transform: [{ translateX: left }] }) })); const tabTitleStyles = createStyles(({ colors }) => ({ default: { base: { color: colors.text.secondary } }, hover: { base: { color: colors.text.primary } }, active: { base: { color: colors.text.brand } } })); const triggerStyles = createStyles(({ space }) => ({ disabled: { base: { opacity: 0.5, pointerEvents: "none" }, web: { base: { cursor: "not-allowed" } } }, trigger: { base: { display: "flex", flexDirection: "row", alignItems: "center" }, ":hover": { backgroundColor: "transparent" } }, sm: { base: { paddingHorizontal: space.md } }, md: { base: { paddingHorizontal: space.xl } }, lg: { base: { paddingHorizontal: space["3xl"] } } })); const heightStyles = createStyles(() => ({ sm: { base: { height: 28 } }, md: { base: { height: 36 } }, lg: { base: { height: 44 } } })); const focusStyles = createStyles(({ colors }) => ({ rounded: { web: { ":focus-visible": { outlineColor: colors.border.brand, outlineOffset: "4px" } } }, underline: { web: { ":focus-visible": { outlineColor: colors.border.brand, outlineOffset: "4px" } } } })); export { focusStyles, heightStyles, indicatorDynamicStyles, indicatorRoundedStyles, indicatorUnderlineStyles, linearGradientRounded, linearGradientUnderline, tabTitleStyles, triggerStyles }; //# sourceMappingURL=styles.js.map