All Projects β†’ dimapaloskin β†’ styled-mixin

dimapaloskin / styled-mixin

Licence: MIT License
Simple wrapper for creating styled-components mixins

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to styled-mixin

Handycontrols
Contains some simple and commonly used WPF controls based on HandyControl
Stars: ✭ 347 (+1941.18%)
Mutual labels:  components, styled-components
Horror
😱 React HTML elements with CSS-in-JS
Stars: ✭ 78 (+358.82%)
Mutual labels:  components, styled-components
React95
πŸŒˆπŸ•Ή Refreshed Windows 95 style UI components for your React app
Stars: ✭ 4,877 (+28588.24%)
Mutual labels:  components, styled-components
Reactackle
Open-source components library built with React and Styled-Components.
Stars: ✭ 278 (+1535.29%)
Mutual labels:  components, styled-components
components
Components library for the Blockchain.com ecosystem πŸ’ πŸ”₯
Stars: ✭ 20 (+17.65%)
Mutual labels:  components, styled-components
Macro Components
Create flexible layout and composite UI components without the need to define arbitrary custom props
Stars: ✭ 485 (+2752.94%)
Mutual labels:  components, styled-components
Design System
Priceline.com Design System
Stars: ✭ 604 (+3452.94%)
Mutual labels:  components, styled-components
Ui
React Styled Components with bootstrap grid system
Stars: ✭ 89 (+423.53%)
Mutual labels:  components, styled-components
Re Jok
A React UI Component library built with styled-components
Stars: ✭ 102 (+500%)
Mutual labels:  components, styled-components
Leaf Ui
πŸƒ Leaf-UI: A react component library built using styled-components
Stars: ✭ 98 (+476.47%)
Mutual labels:  components, styled-components
lab-cli
Command line utilities and exporting module for Compositor Lab
Stars: ✭ 52 (+205.88%)
Mutual labels:  components, styled-components
tsstyled
A small, fast, and simple CSS-in-JS solution for React.
Stars: ✭ 52 (+205.88%)
Mutual labels:  components, styled-components
claxed
Classes with the same style of Styled-Components
Stars: ✭ 17 (+0%)
Mutual labels:  components, styled-components
ng-sq-ui
Flexible and easily customizable UI-kit for Angular 11+
Stars: ✭ 99 (+482.35%)
Mutual labels:  components
chic-ui
Lightweight CSS-in-JS styled UI Component Library for React
Stars: ✭ 39 (+129.41%)
Mutual labels:  styled-components
Alurakut
Projeto desenvolvido durante a ImersΓ£o React da Alura, consiste em uma rede social inspirada no antigo e nostΓ‘lgico Orkut.
Stars: ✭ 13 (-23.53%)
Mutual labels:  styled-components
astro
Build fast websites, faster. πŸš€πŸ§‘β€πŸš€βœ¨
Stars: ✭ 11,024 (+64747.06%)
Mutual labels:  components
el.js
✨ Higher-order elements powered by transclusion.
Stars: ✭ 35 (+105.88%)
Mutual labels:  components
nextjs-admin-template
Free admin dashboard template based on Next.Js with @paljs/ui component package
Stars: ✭ 266 (+1464.71%)
Mutual labels:  styled-components
sleek
A toolbelt for building your next user interface
Stars: ✭ 14 (-17.65%)
Mutual labels:  components

STOP.

just read new styled-components docs now ;)

styled-mixin Build Status

Super simple wrapper for creating styled-components mixins. Perhaps more human-readable syntax for overwrite rules

Install

npm i --save styled-mixin

Usage

Basic

import styled from 'styled-component';
import createMixin from 'styled-mixin';

const tomatoColorMixin = createMixin`
  color: tomato;
`;

const Header = styled.h1`
  color: black;
  font-size: 20px;
`;

const Button = styled.button`
  color: black;
  border: none;
`;

const TomatoHeader = tomatoColorMixin(Header);
const TomatoButton = tomatoColorMixin(Button);

React Native

Use

import createMixin from 'styled-mixin/native';

if you need react-native mode.

Animations

import styled, { keyframes } from 'styled-component';
import createMixin from 'styled-mixin';

const Header = styled.h1`
  color: black;
`;

const rotate360Keyframes = keyframes`
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
`;

const rotate = createMixin`
   animation: ${rotate360Keyframes} 2s linear infinite;
`;

const Uiiiii = rotate(Header);

With props

import styled from 'styled-component';
import createMixin from 'styled-mixin';

const blackOrTomatoMixin = createMixin`
  color: ${ props => props.tomato ? 'tomato' : 'black' };
`;

const Button = blackOrTomatoMixin(styled.button`
  border: none;
`);
<Button tomato>Tomato!!!</Button>

It's nestable

import styled from 'styled-component';
import createMixin from 'styled-mixin';

const Header = styled.h1`
  color: black;
`;

const tomatoColorMixin = createMixin`
  color: tomato;
`;

const fontSizeMixin = createMixin`
  font-size: 20px;
`;

const TomatoHeader = tomatoColorMixin(fontSizeMixin(Header));

Author

Dmitry Pavlovsky

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].