@material-ui/core#lighten TypeScript Examples

The following examples show how to use @material-ui/core#lighten. 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: one-dark.ts    From vscode-crossnote with GNU Affero General Public License v3.0 6 votes vote down vote up
OneDarkTheme: CrossnoteTheme = new CrossnoteTheme({
  name: "one-dark",
  muiThemeOptions: {
    palette: {
      common: { black: "#000", white: "#fff" },
      background: {
        paper: lighten("#282c34", 0.05),
        default: "#282c34",
      },
      primary: cyan,
      secondary: blueGrey,
      error: {
        light: "#e57373",
        main: "#f44336",
        dark: "#d32f2f",
        contrastText: "rgba(197, 197, 197, 1)",
      },
      divider: "#222",
      text: {
        primary: "#ccc",
        secondary: "rgba(180, 180, 180, 1)",
        disabled: "rgba(121, 7, 7, 0.38)",
        hint: "rgba(0, 0, 0, 0.38)",
      },
      action: {
        active: "rgba(180, 180, 180, 1)",
        disabled: "#353535",
      },
    },
  },
})
Example #2
Source File: solarized-light.ts    From vscode-crossnote with GNU Affero General Public License v3.0 6 votes vote down vote up
SolarizedLight: CrossnoteTheme = new CrossnoteTheme({
  name: "solarized-light",
  muiThemeOptions: {
    palette: {
      primary: orange,
      secondary: amber,
      background: {
        paper: lighten("#fdf6e3", 0.05),
        default: "#fdf6e3",
      },
    },
  },
})
Example #3
Source File: TransactionProgress.tsx    From anchor-web-app with Apache License 2.0 6 votes vote down vote up
progressAnimation = (color: string) => keyframes`
  0%    {background: rgba(0,0,0,0.1);}
  10%   {background: ${lighten(color, 0.7)};}
  20%   {background: ${lighten(color, 0.5)};}
  30%   {background: ${lighten(color, 0.3)};}
  40%   {background: ${lighten(color, 0.1)};}
  50%   {background: ${color};}
  60%   {background: ${lighten(color, 0.1)};}
  70%   {background: ${lighten(color, 0.3)};}
  80%   {background: ${lighten(color, 0.5)};}
  90%   {background: ${lighten(color, 0.7)};}
  100%  {background: rgba(0,0,0,0.1);}
`
Example #4
Source File: styles.ts    From backstage with Apache License 2.0 6 votes vote down vote up
useBarChartStepperButtonStyles = makeStyles<CostInsightsTheme>(
  (theme: CostInsightsTheme) =>
    createStyles({
      root: {
        ...theme.typography.button,
        boxSizing: 'border-box',
        transition: theme.transitions.create(
          ['background-color', 'box-shadow', 'border'],
          {
            duration: theme.transitions.duration.short,
          },
        ),
        borderRadius: '50%',
        padding: 0,
        width: 40,
        height: 40,
        boxShadow: theme.shadows[6],
        '&:active': {
          boxShadow: theme.shadows[12],
        },
        color: theme.palette.text.primary,
        backgroundColor: lighten(theme.palette.background.default, 0.1),
        '&:hover': {
          backgroundColor: lighten(theme.palette.background.default, 0.2),
          textDecoration: 'none',
        },
      },
    }),
)
Example #5
Source File: OrderList.tsx    From ra-enterprise-demo with MIT License 6 votes vote down vote up
orderRowStyle =
    (batchLevel, theme) =>
    (record): any => {
        let backgroundColor;
        switch (record.batch) {
            case batchLevel:
                backgroundColor =
                    theme.palette.type === 'light'
                        ? lighten(fade(theme.palette.info.light, 1), 0.68)
                        : darken(fade(theme.palette.info.dark, 1), 0.88);
                break;
            case 1:
                if (batchLevel > 0) {
                    backgroundColor =
                        theme.palette.type === 'light'
                            ? lighten(fade(theme.palette.info.light, 1), 0.78)
                            : darken(fade(theme.palette.info.dark, 1), 0.78);
                }
                break;
            default:
                backgroundColor = theme.palette.background.paper;
        }

        return {
            backgroundColor,
        };
    }
Example #6
Source File: dark.ts    From vscode-crossnote with GNU Affero General Public License v3.0 5 votes vote down vote up
DarkTheme: CrossnoteTheme = new CrossnoteTheme({
  name: "dark",
  muiThemeOptions: {
    palette: {
      common: { black: "#000", white: "#fff" },
      background: {
        paper: lighten("#1e1e1e", 0.05),
        default: "#1e1e1e",
      },
      primary: {
        light: "#7986cb",
        main: "rgba(144, 19, 254, 1)",
        dark: "#303f9f",
        contrastText: "#fff",
      },
      secondary: {
        light: "#ff4081",
        main: "#f50057",
        dark: "#c51162",
        contrastText: "#fff",
      },
      error: {
        light: "#e57373",
        main: "#f44336",
        dark: "#d32f2f",
        contrastText: "rgba(197, 197, 197, 1)",
      },
      divider: "#222",
      text: {
        primary: "#d4d4d4",
        secondary: "rgba(180, 180, 180, 1)",
        disabled: "rgba(121, 7, 7, 0.38)",
        hint: "rgba(0, 0, 0, 0.38)",
      },
      action: {
        active: "rgba(180, 180, 180, 1)",
        disabled: "#353535",
      },
    },
  },
})
Example #7
Source File: styles.ts    From backstage with Apache License 2.0 5 votes vote down vote up
// The opposite of MUI's emphasize function - darken darks, lighten lights
export function brighten(color: string, coefficient = 0.2) {
  return getLuminance(color) > 0.5
    ? lighten(color, coefficient)
    : darken(color, coefficient);
}
Example #8
Source File: styles.ts    From backstage with Apache License 2.0 5 votes vote down vote up
useCostInsightsTabsStyles = makeStyles<BackstageTheme>(
  (theme: BackstageTheme) => ({
    tabs: {
      borderBottom: `1px solid ${theme.palette.textVerySubtle}`,
      backgroundColor: brighten(theme.palette.background.default),
      padding: theme.spacing(0, 4),
    },
    tab: {
      minHeight: 68,
      minWidth: 180,
      padding: theme.spacing(1, 4),
      '&:hover': {
        color: 'inherit',
        backgroundColor: 'inherit',
      },
    },
    indicator: {
      backgroundColor: theme.palette.navigation.indicator,
      height: 4,
    },
    tabLabel: {
      display: 'flex',
      alignItems: 'center',
    },
    tabLabelText: {
      fontSize: theme.typography.fontSize,
      fontWeight: theme.typography.fontWeightBold,
    },
    menuItem: {
      display: 'flex',
      justifyContent: 'space-between',
      alignItems: 'center',
      minWidth: 180,
      padding: theme.spacing(2, 2),
    },
    menuItemSelected: {
      backgroundColor: lighten(theme.palette.background.default, 0.3),
    },
  }),
)
Example #9
Source File: styles.ts    From firetable with Apache License 2.0 4 votes vote down vote up
useStyles = makeStyles((theme) =>
  createStyles({
    tableWrapper: {
      display: "flex",
      flexDirection: "column",
      width: `calc(100% - ${DRAWER_COLLAPSED_WIDTH}px)`,
      height: `calc(100vh - ${APP_BAR_HEIGHT}px)`,

      "& > .rdg": { flex: 1 },

      [theme.breakpoints.down("sm")]: { width: "100%" },
    },

    loadingContainer: {
      position: "sticky",
      left: 0,
      height: 100,
    },

    "@global": {
      ".rdg.rdg": {
        "--color": theme.palette.text.secondary,
        "--border-color": theme.palette.divider,
        // "--summary-border-color": "#aaa",
        "--background-color": theme.palette.background.paper,
        "--header-background-color": theme.palette.background.default,
        "--row-hover-background-color": emphasize(
          theme.palette.background.paper,
          0.04
        ),
        "--row-selected-background-color":
          theme.palette.type === "light"
            ? lighten(theme.palette.primary.main, 0.9)
            : darken(theme.palette.primary.main, 0.8),
        "--row-selected-hover-background-color":
          theme.palette.type === "light"
            ? lighten(theme.palette.primary.main, 0.8)
            : darken(theme.palette.primary.main, 0.7),
        "--checkbox-color": theme.palette.primary.main,
        "--checkbox-focus-color": theme.palette.primary.main,
        "--checkbox-disabled-border-color": "#ccc",
        "--checkbox-disabled-background-color": "#ddd",
        "--selection-color": theme.palette.primary.main,
        "--font-size": "0.75rem",
        "--cell-padding": theme.spacing(0, 1.5),

        border: "none",
        backgroundColor: "transparent",

        ...theme.typography.body2,
        fontSize: "0.75rem",
        lineHeight: "inherit !important",

        "& .rdg-cell": {
          display: "flex",
          alignItems: "center",
          padding: "var(--cell-padding)",

          overflow: "visible",
          contain: "none",
        },

        "& .rdg-cell-frozen-last": {
          boxShadow:
            theme.palette.type === "light"
              ? "2px 0 4px 0px rgba(0, 0, 0, .08)"
              : "2px 0 4px 0px rgba(0, 0, 0, .67)",
        },

        "& .rdg-cell-copied": {
          backgroundColor:
            theme.palette.type === "light"
              ? lighten(theme.palette.primary.main, 0.7)
              : darken(theme.palette.primary.main, 0.6),
        },
      },

      ".rdg-header-row .rdg-cell": {
        borderTop: "1px solid var(--border-color)",
      },

      ".rdg-row:hover": { color: theme.palette.text.primary },

      ".row-hover-iconButton": {
        color: theme.palette.text.disabled,
        transitionDuration: "0s",

        ".rdg-row:hover &": {
          color: theme.palette.text.primary,
          backgroundColor: fade(
            theme.palette.text.primary,
            theme.palette.action.hoverOpacity * 2
          ),
        },
      },

      ".cell-collapse-padding": {
        margin: theme.spacing(0, -1.5),
        width: `calc(100% + ${theme.spacing(3)}px)`,
      },
    },
  })
)