Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mui/styled-engine-sc

Package Overview
Dependencies
Maintainers
9
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mui/styled-engine-sc

styled() API wrapper package for styled-components.

  • 5.14.12
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
253K
decreased by-16.63%
Maintainers
9
Weekly downloads
 
Created

What is @mui/styled-engine-sc?

@mui/styled-engine-sc is a styling solution for Material-UI that leverages styled-components. It allows you to create custom-styled components using the styled-components library while maintaining compatibility with Material-UI's theming and styling system.

What are @mui/styled-engine-sc's main functionalities?

Custom Styled Components

This feature allows you to create custom-styled components using the styled-components syntax. The example demonstrates how to style a Material-UI Button component with a gradient background, custom padding, and other CSS properties.

const MyButton = styled(Button)`
  background: linear-gradient(45deg, #FE6B8B 30%, #FF8E53 90%);
  border: 0;
  border-radius: 3px;
  box-shadow: 0 3px 5px 2px rgba(255, 105, 135, .3);
  color: white;
  height: 48px;
  padding: 0 30px;
`;

<MyButton>Styled Button</MyButton>;

Theming

This feature allows you to use Material-UI's theming capabilities with styled-components. The example shows how to create a custom theme and apply it to a styled component, utilizing theme properties like palette and spacing.

const theme = createTheme({
  palette: {
    primary: {
      main: '#1976d2',
    },
  },
});

const MyComponent = styled('div')(({ theme }) => ({
  backgroundColor: theme.palette.primary.main,
  padding: theme.spacing(2),
  borderRadius: theme.shape.borderRadius,
}));

<ThemeProvider theme={theme}>
  <MyComponent>Styled with Theme</MyComponent>
</ThemeProvider>;

Responsive Styles

This feature allows you to create responsive styles using media queries within styled-components. The example demonstrates how to change the background color of a div based on different screen widths.

const ResponsiveBox = styled('div')`
  width: 100%;
  height: 100px;
  background-color: lightblue;

  @media (min-width: 600px) {
    background-color: lightgreen;
  }

  @media (min-width: 960px) {
    background-color: lightcoral;
  }
`;

<ResponsiveBox>Responsive Box</ResponsiveBox>;

Other packages similar to @mui/styled-engine-sc

Keywords

FAQs

Package last updated on 04 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc