All Projects → foliage-ui → foliage

foliage-ui / foliage

Licence: other
🍃 Style your components with performance

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to foliage

Goober
🥜 goober, a less than 1KB 🎉 css-in-js alternative with a familiar API
Stars: ✭ 2,317 (+7889.66%)
Mutual labels:  styled-components, dom, styled
nebuchadnezzar
on the way to cleanest react architechture
Stars: ✭ 15 (-48.28%)
Mutual labels:  styled-components, styled
shorted-theme
Shorted theme references for Styled Components.
Stars: ✭ 13 (-55.17%)
Mutual labels:  styled-components, styled
Styled-Responsive-Media-Queries
Responsive Media Queries for Emotion styled or styled-components — Standard size from Chrome DevTools.
Stars: ✭ 33 (+13.79%)
Mutual labels:  styled-components, styled
razzle-template
SSR template with React, Effector, TypeScript, ReactRouter, and StyledComponents
Stars: ✭ 62 (+113.79%)
Mutual labels:  styled-components, effector
Styled Elements
Styled components for the DOM.
Stars: ✭ 87 (+200%)
Mutual labels:  styled-components, dom
jss-material-ui
A enhanced styling engine for material-ui
Stars: ✭ 15 (-48.28%)
Mutual labels:  styled-components, styled
react-styled-floating-label
Floating label component which works with any HTML input
Stars: ✭ 33 (+13.79%)
Mutual labels:  styled-components, styled
babel-plugin-styled-name
Name for your styled-components in development
Stars: ✭ 16 (-44.83%)
Mutual labels:  styled-components
react-native-ecommerce
E-commerce mobile application developed using React Native 👔 🎩
Stars: ✭ 60 (+106.9%)
Mutual labels:  styled-components
utd-grades
A tool to view grade distributions at UT Dallas.
Stars: ✭ 23 (-20.69%)
Mutual labels:  styled-components
sapa
sapa is a library that creates a UI with a simple event system.
Stars: ✭ 65 (+124.14%)
Mutual labels:  dom
bemto-button
Foundation for complex reusable buttons in React
Stars: ✭ 18 (-37.93%)
Mutual labels:  styled-components
paginathing
a jQuery plugin to paginate your DOM easily.
Stars: ✭ 23 (-20.69%)
Mutual labels:  dom
react-weather-app
Weather App built with React & TypeScript
Stars: ✭ 61 (+110.34%)
Mutual labels:  styled-components
cargo-react
A Boilerplate for creating Component Libraries in React + Typescript + StoryBook + Styled Components
Stars: ✭ 13 (-55.17%)
Mutual labels:  styled-components
CDom
Simple HTML/XML/BBCode DOM component for PHP.
Stars: ✭ 26 (-10.34%)
Mutual labels:  dom
Proffy
👥 Plataforma de estudos online, onde é possível conectar alunos com professores. Este é um projeto que foi desenvolvido durante a Next Level Week #2 da @Rocketseat, durante os dias 3 à 7 de agosto de 2020.
Stars: ✭ 12 (-58.62%)
Mutual labels:  styled-components
cljs-styled-components
ClojureScript wrapper for styled-components
Stars: ✭ 43 (+48.28%)
Mutual labels:  styled-components
lab-cli
Command line utilities and exporting module for Compositor Lab
Stars: ✭ 52 (+79.31%)
Mutual labels:  styled-components

foliage 🍃

GitHub dev.to

Usage with React

Work in progress. Most of this examples are just concept

import { css, component } from 'foliage-react';

const button = css`
  display: inline-block;
  border-radius: 3px;
  padding: 0.5rem 0;
  margin: 0.5rem 1rem;
  width: 11rem;
  border: 2px solid white;
`;

export const Button = component('a', button, {
  defaults: { color: 'default' },
  variants: {
    color: {
      primary: css`
        background: white;
        color: black;
      `,
      default: css`
        background: transparent;
        color: white;
      `,
    },
  },
});

Extending styles

import { css, component } from 'foliage-react';

const button = css`
  color: palevioletred;
  font-size: 1em;
  margin: 1em;
  padding: 0.25em 1em;
  border: 2px solid palevioletred;
  border-radius: 3px;
`;

export const Button = component('button', button);

const tomato = css`
  color: tomato;
  border-color: tomato;
`;

export const TomatoButton = component('button', [button, tomato]);

Pseudoelement, pseudoselectors, and nesting

import { css, component } from 'foliage-react';

const thing = css`
  color: blue;

  &:hover {
    color: red; // <Thing> when hovered
  }

  & ~ & {
    background: tomato; // <Thing> as a sibling of <Thing>, but maybe not directly next to it
  }

  & + & {
    background: lime; // <Thing> next to <Thing>
  }

  &.something {
    background: orange; // <Thing> tagged with an additional CSS class ".something"
  }

  .something-else & {
    border: 1px solid; // <Thing> inside another element labeled ".something-else"
  }
`;

export const Thing = component('div', thing, { attrs: { tabIndex: 0 } });

const Example = () => (
  <>
    <Thing>Hello world!</Thing>
    <Thing>How ya doing?</Thing>
    <Thing className="something">The sun is shining...</Thing>
    <div>Pretty nice day today.</div>
    <Thing>Don't you think?</Thing>
    <div className="something-else">
      <Thing>Splendid.</Thing>
    </div>
  </>
);

Animations

import { css, keyframes, component } from 'foliage-react';

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

const block = css`
  display: inline-block;
  animation: ${rotate} 2s linear infinite;
  padding: 2rem 1rem;
  font-size: 1.2rem;
`;

export const Block = component('div', block);

Theming

import { css, keyframes, createGlobalStyle, Global } from 'foliage-react';
const theme = {
  main: '--theme-main',
};

const button = css`
  font-size: 1em;
  margin: 1em;
  padding: 0.25em 1em;
  border-radius: 3px;

  /* Color the border and text with theme.main */
  color: var(${theme.main});
  border: 2px solid var(${theme.main});
`;

const Button = component('button', button);

const primaryTheme = createGlobalStyle`
  :root {
    ${theme.main}: palevioletred;
  }
`;

const secondaryTheme = createGlobalStyle`
  :root {
    ${theme.main}: mediumseagreen;
  }
`;

const Example = () => (
  <>
    <Global styles={primaryTheme} />
    <Button />
  </>
);

Composable components

import { css, component } from 'foliage-react';

const baseStyles = css`
  color: white;
  background-color: mediumseagreen;
  border-radius: 4px;
`;

export const Button = component('button', baseStyles, {
  variants: {
    color: {
      gray: css`
        background-color: gainsboro;
      `,
      blue: css`
        background-color: dodgerblue;
      `,
    },
    size: {
      md: css`
        height: 26px;
      `,
      lg: css`
        height: 36px;
      `,
    },
  },
  compound: [
    {
      color: 'blue',
      size: 'lg',
      css: css`
        background-color: purple;
      `,
    },
  ],
  defaults: {
    color: 'gray',
    size: 'md',
  },
});

Release process

  1. Check out the draft release.
  2. All PRs should have correct labels and useful titles. You can review available labels here.
  3. Update labels for PRs and titles, next manually run the release drafter action to regenerate the draft release.
  4. Review the new version and press "Publish"
  5. If required check "Create discussion for this release"
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].