How to use the @material-ui/styles.styled function in @material-ui/styles

To help you get started, we’ve selected a few @material-ui/styles 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 quiltdata / quilt / catalog / app / components / Working / index.js View on Github external
/* Authentication progress */
import PropTypes from 'prop-types'
import React from 'react'
import { FormattedMessage } from 'react-intl'
import { styled } from '@material-ui/styles'

import Spinner from 'components/Spinner'

import messages from './messages'

const Faint = styled('h1')({
  fontWeight: 'lighter',
  opacity: 0.6,
})

const Working = ({ children, ...props }) => (
  
    
    {children}
  
)

Working.propTypes = {
  children: PropTypes.node,
}

Working.defaultProps = {
github mui-org / material-ui / packages / material-ui-benchmark / src / system.js View on Github external
const suite = new Benchmark.Suite('system', {
  onError: event => {
    console.log(event.target.error);
  },
});
Benchmark.options.minSamples = 100;

const materialSystem = compose(
  palette,
  spacing,
  typography,
);
const styledSystem = compose2(color, space, fontFamily, fontSize);

const BoxStyles = styled('div')(styleFunction);
const BoxStyleComponents = styledComponents('div')(styleFunction);
const NakedStyleComponents = styledComponents('div')(spacing);
const BoxEmotion = styledEmotion('div')(styleFunction);

const BoxMaterialSystem = styledComponents('div')(materialSystem);
const BoxStyledSystem = styledComponents('div')(styledSystem);

const materialSystemTheme = createMuiTheme();

const styledSystemTheme = createMuiTheme();
styledSystemTheme.breakpoints = ['40em', '52em', '64em'];
styledSystemTheme.colors = styledSystemTheme.palette;
styledSystemTheme.fontSizes = styledSystemTheme.typography;
styledSystemTheme.fonts = styledSystemTheme.typography;

suite
github PacktPublishing / React-Material-UI-Cookbook / src / Chapter20Style / OtherStylingOptions.js View on Github external
import React, { Fragment } from 'react';

import { styled } from '@material-ui/styles';
import Button from '@material-ui/core/Button';

import styles from './OtherStylingOptions.module.css';

const MyStyledButton = styled(Button)({
  margin: 16,
  paddingTop: 16,
  paddingBottom: 16
});

const OtherStylingOptions = () => (
  
    <button style="{{">My Default Button</button>
    
      My Contained Button
    
    <button color="primary"></button>
github pietrzakadrian / bank / frontend / app / components / App / Header / HamburgerWrapper.js View on Github external
/**
 *
 * HamburgerWrapper
 *
 */

import { styled } from '@material-ui/styles';

import { PRIMARY_BLUE_DARK } from 'utils/colors';
import IconButton from '@material-ui/core/IconButton';

const HamburgerWrapper = styled(IconButton)({
  color: `${PRIMARY_BLUE_DARK}`,
});

export default HamburgerWrapper;
github SE-GUC / Access-denied / client / src / Screens / CertAccept.js View on Github external
import indigo from '@material-ui/core/colors/indigo'
import { styled } from '@material-ui/styles'
import LinearProgress from '@material-ui/core/LinearProgress'
import Applyontask from './ApplyOnTask'
import PropTypes from 'prop-types'
import { withStyles } from '@material-ui/core/styles'
import List from '@material-ui/core/List'
import ListItem from '@material-ui/core/ListItem'
import ListItemIcon from '@material-ui/core/ListItemIcon'
import ListItemText from '@material-ui/core/ListItemText'
import InboxIcon from '@material-ui/icons/Inbox'
import DraftsIcon from '@material-ui/icons/Drafts'

const axios = require('axios')

const Typographyhead = styled(Typography)({
  color: indigo[400],
  marginLeft: '1.5%'
})
const Typographypara = styled(Typography)({
  marginLeft: '1.5%'
})

const styles = theme => ({
  root: {
    width: '100%',
    maxWidth: 360,
    backgroundColor: theme.palette.background.paper
  }
})
class CertAccept extends Component {
  constructor(props) {
github alex996 / graphql-chat / packages / web / src / views / layouts / NavBar.tsx View on Github external
import React from 'react'
import { styled } from '@material-ui/styles'
import { Link, AppBar, Toolbar, IconButton } from '@material-ui/core'
import { AdapterLink } from '../../components'
import { MoreVert } from '../../icons'
import { SideBar } from './'

const FullWidth = styled('div')({
  flexGrow: 1
})

const Navbar = () =&gt; (
  
    
      
      
        
          GraphQL Chat
github mui-org / material-ui / packages / material-ui-benchmark / src / server.js View on Github external
StylesProvider,
  ThemeProvider,
  createGenerateClassName,
} from '@material-ui/styles';
import { green, red } from '@material-ui/core/colors';
import Pricing from 'docs/src/pages/getting-started/templates/pricing/Pricing';
import { spacing, palette } from '@material-ui/system';
import Avatar from '@material-ui/core/Avatar';
import Box, { styleFunction } from '@material-ui/core/Box';
import styledComponents, { ServerStyleSheet } from 'styled-components';
import styledEmotion from '@emotion/styled';

const StyledBox = styledComponents('div')`${styleFunction}`;
const EmotionBox = styledEmotion('div')`${styleFunction}`;

const StyledFunction = materialStyled('div')(() =&gt; ({
  color: 'blue',
}));

function renderFullPage(html, css) {
  return `
    
    
      
        <title>My page</title>
        <style id="jss-server-side">${css}</style>
      
      
        <div id="root">${html}</div>
      
    
  `;
github quiltdata / quilt / catalog / app / containers / Auth / Code.js View on Github external
import Button from '@material-ui/core/Button'
import { styled } from '@material-ui/styles'

import Working from 'components/Working'
import * as Sentry from 'utils/Sentry'
import copyToClipboard from 'utils/clipboard'
import defer from 'utils/defer'
import { composeComponent } from 'utils/reactTools'

import { getCode } from './actions'
import msg from './messages'
import * as Layout from './Layout'

const Container = Layout.mkLayout()

const Code = styled('div')({
  overflowWrap: 'break-word',
})

export default composeComponent(
  'Auth.Code',
  connect(),
  withStateHandlers(
    {
      result: null,
    },
    {
      setResult: () =&gt; (result) =&gt; ({ result }),
    },
  ),
  withHandlers({
    copy: ({ result }) =&gt; () =&gt; {
github quiltdata / quilt / catalog / app / containers / Bucket / FilePreview.js View on Github external
import * as React from 'react'
import Button from '@material-ui/core/Button'
import CircularProgress from '@material-ui/core/CircularProgress'
import Typography from '@material-ui/core/Typography'
import { styled } from '@material-ui/styles'

import * as Preview from 'components/Preview'
import AsyncResult from 'utils/AsyncResult'

import { withSignedUrl } from './utils'

const Message = styled('div')({
  textAlign: 'center',
  width: '100%',
})

export default ({ handle }) =&gt;
  Preview.load(
    handle,
    AsyncResult.case({
      Ok: AsyncResult.case({
        Init: (_, { fetch }) =&gt; (
          
            
              Large files are not previewed automatically
            
            <button>
              Load preview</button>
github pietrzakadrian / bank / app / components / Footer / ErrorOutlineIcon.js View on Github external
import ErrorOutline from '@material-ui/icons/ErrorOutline';
import { styled } from '@material-ui/styles';

const ErrorOutlineIcon = styled(ErrorOutline)({
  fontSize: 32,
  margin: '-1px 6px 0 0',
});

export default ErrorOutlineIcon;