How to use the @emotion/styled function in @emotion/styled

To help you get started, we’ve selected a few @emotion/styled examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lyft / clutch / frontend / packages / core / src / AppLayout / user.tsx View on Github external
Avatar as MuiAvatar,
  ClickAwayListener,
  Divider as MuiDivider,
  Grow as MuiGrow,
  IconButton,
  ListItemIcon,
  ListItemText as MuiListItemText,
  MenuItem as MuiMenuItem,
  MenuList as MuiMenuList,
  Paper as MuiPaper,
  Popper as MuiPopper,
} from "@material-ui/core";
import Cookies from "js-cookie";
import jwtDecode from "jwt-decode";

const UserPhoto = styled(IconButton)({
  padding: "12px",
  "&:hover": {
    background: "#2d3db4",
  },
  "&:active": {
    background: "#2938a5",
  },
  // avatar on header
  ".MuiAvatar-root": {
    height: "32px",
    width: "32px",
    fontSize: "14px",
    lineHeight: "18px",
  },
});
github Workday / canvas-kit / modules / radio / react / lib / Radio.tsx View on Github external
backgroundColor: colors.frenchVanilla100,
    borderRadius: radioBorderRadius,
    display: 'flex',
    flexDirection: 'column',
    height: radioDot,
    pointerEvents: 'none',
    transition: 'transform 200ms ease, opacity 200ms ease',
    width: radioDot,
  },
  ({checked}) => ({
    opacity: checked ? 1 : 0,
    transform: checked ? 'scale(1)' : 'scale(0.5)',
  })
);

const RadioLabel = styled('label')<{disabled?: boolean}>(
  {
    ...canvas.type.body,
    paddingLeft: radioLabelDistance,
  },
  ({disabled}) => (disabled ? {color: inputColors.disabled.text} : {cursor: 'pointer'})
);

export default class Radio extends React.Component {
  public static defaultProps = {
    checked: false,
    label: '',
  };

  private id = uuid();

  public render() {
github ensdomains / ens-app / src / components / Icons / DogTag.js View on Github external
import React from 'react'
import styled from '@emotion/styled'
import Icon from './IconBase'

const SVG = styled(Icon)``

const DogTag = ({ active }) => (
  <svg height="23" width="23">
    <path fill="#C7D3E3" d="M9.067 9.111a2.234 2.234 0 0 1-1.556.667 2.233 2.233 0 0 1-1.555-.667c-.445-.4-.667-.978-.667-1.556 0-.577.267-1.155.667-1.6.4-.444.978-.666 1.555-.666.578 0 1.112.222 1.556.666a2.2 2.2 0 0 1 0 3.156M21.91 11.29L11.423.89C10.889.355 10.133.044 9.378 0h-.133L1.823 1.244a.66.66 0 0 0-.578.578L0 9.244v.134c0 .755.31 1.511.889 2.044l10.445 10.445a3.533 3.533 0 0 0 2.533 1.066c.844 0 1.689-.31 2.356-.978L22 16.178c1.334-1.334 1.289-3.51-.09-4.889"></path>
  </svg>
)

export default DogTag
github jlengstorf / lengstorf.com / src / components / Footnotes.js View on Github external
color: ${colors.lightest};
    font-size: 0.625rem;
    font-weight: 500;
    line-height: 1rem;
    text-align: center;
  }
`;

const Text = styled('div')`
  max-height: 240px;
  font-size: 90%;
  padding-bottom: 30px;
  overflow-y: scroll;
`;

const Close = styled('a')`
  border-radius: 0.5rem;
  color: ${colors.gray};
  font-size: 0.625rem;
  font-variant: small-caps;
  letter-spacing: 0.05em;
  line-height: 1;
  margin: 0;
  padding: 0 0.25rem 0.2rem;
  position: absolute;
  right: 0;
  text-decoration: none;
  top: 0;

  ::after {
    content: '×';
    margin-left: 0.25rem;
github neo-one-suite / neo-one / packages / neo-one-website / src / components / reference / common / Example.tsx View on Github external
import styled from '@emotion/styled';
import { Box } from '@neo-one/react-common';
import * as React from 'react';
import { prop } from 'styled-tools';
import { WordTokens } from '../types';
import { buildExample } from './utils';

interface Props {
  readonly example: WordTokens;
  readonly className?: string;
}

const PreWrapper = styled(Box.withComponent('pre'))`
  background-color: ${prop('theme.gray6')};
  ${prop('theme.fontStyles.subheading')};
  font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
  padding: 16px;
  border-radius: 4px;
`;

const CodeWrapper = styled(Box.withComponent('code'))`
  ${prop('theme.fontStyles.subheading')};
  font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
`;

export const Example = ({ example, className = 'language-typescript', ...props }: Props) =&gt; (
  
    {buildExample(example)}
github lyft / clutch / frontend / packages / core / src / loading.tsx View on Github external
import React from "react";
import styled from "@emotion/styled";
import { CircularProgress, Grid, Paper } from "@material-ui/core";

const LoadingSpinner = styled(CircularProgress)`
  color: #3548d4;
  position: absolute;
`;

const ContentContainer = styled(Grid)`
  position: relative;
`;

const ChildrenContainer = styled.div({
  width: "100%",
});

const Overlay = styled(Paper)`
  position: absolute;
  height: 105%;
  width: 105%;
github SubstraFoundation / substra-frontend / src / app / business / common / components / detail / components / iconButton.js View on Github external
import styled from '@emotion/styled';
import {ice} from '../../../../../../../assets/css/variables/colors';

export default styled('button')`
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 15px;
    border: 1px solid ${ice};
    padding: 0;
    background: none;
    
    &:hover {
        background-color: ${ice};
        transition: background-color 200ms ease-out;
    }
`;
github jamaljsr / polar / src / components / network / NetworkActions.tsx View on Github external
import React from 'react';
import { useAsyncCallback } from 'react-async-hook';
import styled from '@emotion/styled';
import { Button, Divider, Dropdown, Icon, Menu, Tag } from 'antd';
import { ButtonType } from 'antd/lib/button';
import { usePrefixedTranslation } from 'hooks';
import { Status } from 'shared/types';
import { useStoreActions, useStoreState } from 'store';
import { Network } from 'types';

const Styled = {
  Button: styled(Button)`
    margin-left: 0;
  `,
  MenuIcon: styled(Icon)`
    margin-right: 5px;
  `,
};

interface Props {
  network: Network;
  onClick: () => void;
  onRenameClick: () => void;
  onDeleteClick: () => void;
}

const config: {
  [key: number]: {
github Workday / canvas-kit / modules / page-header / react / lib / PageHeader.tsx View on Github external
import * as React from 'react';
import styled from '@emotion/styled';
import {colors, spacing, type} from '@workday/canvas-kit-react-core';
import {IconButton, IconButtonProps} from '@workday/canvas-kit-react-button';

export interface PageHeaderProps {
  title: string;
  capWidth: boolean;
  breakpoint?: number;
}

const Header = styled('header')({
  height: 84,
  backgroundImage: colors.gradients.blueberry,
  color: colors.frenchVanilla100,
  WebkitFontSmoothing: 'antialiased',
  MozOsxFontSmoothing: 'grayscale',
});

const Container = styled('div')&gt;(
  {
    display: 'flex',
    alignItems: 'center',
    justifyContent: 'space-between',
    height: '100%',
    overflow: 'hidden',
    padding: `0 ${spacing.s}`,
  },
github tachyons-css / tachyons-styled-react / src / elements / Kbd.js View on Github external
import styled from "@emotion/styled"
import shouldForwardProp from "@styled-system/should-forward-prop"
import {
  space,
  width,
  fontSize,
  textStyle,
  color,
  borders,
  borderColor,
  borderRadius
} from "styled-system"

const Kbd = styled('code', { shouldForwardProp })(
  space,
  width,
  fontSize,
  textStyle,
  color,
  borders,
  borderColor,
  borderRadius,
  {
    boxSizing: "border-box",
    fontFamily: "monospace, monospace"
  }
)

Kbd.defaultProps = {
  fontSize: 2