@material-ui/core#alpha TypeScript Examples

The following examples show how to use @material-ui/core#alpha. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CartSummary.tsx    From storefront with MIT License 6 votes vote down vote up
useStyles = makeStyles(
  ({ palette }) => ({
    table: {
      borderTop: `1px solid ${darken(alpha(palette.divider, 1), 0.68)}`,
    },

    tableRow: {
      '& td:first-of-type': {
        paddingLeft: 0,
      },

      '& td:last-of-type': {
        paddingRight: 0,
      },
    },

    image: {
      height: 'auto',
      width: 64,
    },

    total: {
      fontSize: 16,
    },
  }),
  { name: 'CartSummary' },
)
Example #2
Source File: SchemaBrowser.tsx    From backstage with Apache License 2.0 6 votes vote down vote up
StyledTreeItem = withStyles(theme =>
  createStyles({
    label: {
      userSelect: 'none',
    },
    group: {
      marginLeft: 7,
      paddingLeft: theme.spacing(1),
      borderLeft: `1px solid ${alpha(theme.palette.text.primary, 0.15)}`,
    },
  }),
)((props: TreeItemProps) => <TreeItem {...props} />)
Example #3
Source File: CartTable.tsx    From storefront with MIT License 5 votes vote down vote up
useStyles = makeStyles(
  ({ breakpoints, palette }) => ({
    root: {
      borderTop: `1px solid ${darken(alpha(palette.divider, 1), 0.68)}`,
      display: 'block',

      [breakpoints.up('sm')]: {
        borderTop: 0,
        display: 'table',
      },
    },

    footer: {
      display: 'block',

      [breakpoints.up('sm')]: {
        display: 'table-footer-group',
      },

      '& tr': {
        display: 'flex',

        [breakpoints.up('sm')]: {
          display: 'table-row',
        },
      },

      '& td': {
        '&:nth-of-type(n+2)': {
          flexGrow: 1,
        },

        '&:nth-of-type(3)': {
          textAlign: 'right',

          [breakpoints.up('sm')]: {
            textAlign: 'left',
          },
        },
      },
    },
  }),
  { name: 'CartTable' },
)
Example #4
Source File: RichText.tsx    From storefront with MIT License 5 votes vote down vote up
useStyles = makeStyles(
  ({ palette, spacing, typography }) => ({
    root: {
      '& h2, & h3, & h4, & h5, & p': {
        marginBottom: spacing(2),
        marginTop: 0,
      },

      '& h2': {
        ...typography.h2,
      },

      '& h3': {
        ...typography.h3,
      },

      '& h4': {
        ...typography.h4,
      },

      '& h5': {
        ...typography.h5,
      },

      '& p': {
        ...typography.body1,
      },

      '& a': {
        color: palette.common.white,
        textDecoration: 'none',

        '&:hover': {
          textDecoration: 'underline',
        },
      },

      '& table': {
        borderCollapse: 'collapse',
        marginBottom: spacing(2),

        '& th, & td': {
          ...typography.body2,
          borderBottom: `1px solid ${darken(alpha(palette.divider, 1), 0.68)}`,
          padding: spacing(1),
          textAlign: 'left',
        },
      },

      '& .alignright': {
        float: 'right',
      },
    },
  }),
  { name: 'RichText' },
)