All Projects → LeetCode-OpenSource → emotion-ts-plugin

LeetCode-OpenSource / emotion-ts-plugin

Licence: MIT license
TypeScript Emotion Plugin . https://emotion.sh/

Programming Languages

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

Labels

Projects that are alternatives of or similar to emotion-ts-plugin

Senti4SD
An emotion-polarity classifier specifically trained on developers' communication channels
Stars: ✭ 41 (-28.07%)
Mutual labels:  emotion
habitus
🏄 State-of-the-art Tracker for emotions, habits and thoughts. | Gamified. | Anonymous and open source. | Healthiest version of you
Stars: ✭ 23 (-59.65%)
Mutual labels:  emotion
wellbeing
Welbeing activity log and visualization tool.
Stars: ✭ 11 (-80.7%)
Mutual labels:  emotion
plexus
Plexus - Interactive Emotion Visualization based on Social Media
Stars: ✭ 27 (-52.63%)
Mutual labels:  emotion
gatsby-typescript-emotion-storybook
Gatsby Starter: TypeScript + Emotion + Storybook + React Intl + SVGR + Jest
Stars: ✭ 63 (+10.53%)
Mutual labels:  emotion
intenseye-boun-workshop
Code for the workshop in BOUN Tech Summit (03.03.2019)
Stars: ✭ 32 (-43.86%)
Mutual labels:  emotion
AffectiveTweets
A WEKA package for analyzing emotion and sentiment of tweets.
Stars: ✭ 74 (+29.82%)
Mutual labels:  emotion
Emotion-Investigator
An Exciting Deep Learning-based Flask web app that predicts the Facial Expressions of users and also does Graphical Visualization of the Expressions.
Stars: ✭ 44 (-22.81%)
Mutual labels:  emotion
monad-ui
Utility First CSS-in-JS
Stars: ✭ 33 (-42.11%)
Mutual labels:  emotion
RECCON
This repository contains the dataset and the PyTorch implementations of the models from the paper Recognizing Emotion Cause in Conversations.
Stars: ✭ 126 (+121.05%)
Mutual labels:  emotion
rebass
⚛️ React primitive UI components built with styled-system.
Stars: ✭ 7,844 (+13661.4%)
Mutual labels:  emotion
NRCLex
An affect generator based on TextBlob and the NRC affect lexicon. Note that lexicon license is for research purposes only.
Stars: ✭ 42 (-26.32%)
Mutual labels:  emotion
emotion-recognition-GAN
This project is a semi-supervised approach to detect emotions on faces in-the-wild using GAN
Stars: ✭ 20 (-64.91%)
Mutual labels:  emotion
css-in-js-media
🎨 Deal with responsive design simply when use CSS-in-JS (styled-components,emotion.js)
Stars: ✭ 137 (+140.35%)
Mutual labels:  emotion
chanyeong
👨‍💻 chanyeong's portfolio and blog webpage
Stars: ✭ 39 (-31.58%)
Mutual labels:  emotion
FacialEmotionRecognition
Using Extended Cohn-Kanade AU-Coded Facial Expression Database to classify basic human facial emotion expressions using ann
Stars: ✭ 28 (-50.88%)
Mutual labels:  emotion
party-pi
Computer vision emotion 😜 detection game in Flask with TensorFlow backend.
Stars: ✭ 28 (-50.88%)
Mutual labels:  emotion
RelaxingRain
App for relax, focus yourself with the sound of rain, thunder and wind
Stars: ✭ 16 (-71.93%)
Mutual labels:  emotion
fusion-components
A collection of React Components built with Emotion.js
Stars: ✭ 13 (-77.19%)
Mutual labels:  emotion
react-vite-twin-macro
Just want to try react, vite and twin.macro
Stars: ✭ 17 (-70.18%)
Mutual labels:  emotion

Emotion TypeScript Plugin

CircleCI codecov Downloads

Features

Feature/Syntax Native Babel Plugin TypeScript Plugin Notes
css``
css(...) Generally used for object styles.
styled('div')`` syntax Both string and object styles work without this plugin.
styled.div`` syntax Supporting the shortcut syntax without the Babel plugin requires a large list of valid elements to be included in the bundle.
components as selectors Allows an emotion component to be used as a CSS selector.
Minification ⛔️ Any leading/trailing space between properties in your css and styled blocks is removed. This can reduce the size of your final bundle.
Dead Code Elimination Uglifyjs will use the injected /*#__PURE__*/ flag comments to mark your css and styled blocks as candidates for dead code elimination.
Source Maps When enabled, navigate directly to the style declaration in your javascript file.
Contextual Class Names Generated class names include the name of the variable or component they were defined in.

Usage

const { join } = require('path')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')

const { createEmotionPlugin } = require('emotion-ts-plugin')

module.exports = {
  entry: './tests/fixtures/simple.tsx',

  output: {
    filename: '[name].[hash].js',
    path: join(process.cwd(), 'dist'),
  },

  resolve: {
    extensions: ['.tsx', '.ts', '.js', '.jsx'],
  },

  mode: 'development',

  devtool: 'cheap-module-source-map',

  module: {
    rules: [
      {
        test: /\.(j|t)sx?$/,
        loader: 'ts-loader',
        options: {
          transpileOnly: true,
          getCustomTransformers: () => ({
            before: [
              createEmotionPlugin({
                // <------------------- here
                sourcemap: true,
                autoLabel: true,
                labelFormat: '[local]',
                // if the jsxFactory is set, should we auto insert the import statement
                autoInject: true,
                // set for react@17 new jsx runtime
                // only effect if `autoInject` is true
                // set it in createEmotionPlugin options rather than in `tsconfig.json` will generate more optimized codes:
                // import { jsx } from 'react/jsx-runtime' for files not using emotion
                // import { jsx } from '@emotion/react/jsx-runtime' for files using emotion
                jsxImportSource: '@emotion/react',
              }),
            ],
          }),
          compilerOptions: {
            // set jsx pragma to jsx or alias which is from the @emotion/react package to enable css property in jsx component
            jsxFactory: 'jsx',
          },
        },
        exclude: /node_modules/,
      },
      {
        test: /\.css$/,
        use: [MiniCssExtractPlugin.loader, 'css-loader?minimize'],
      },
    ],
  },

  plugins: [
    new HtmlWebpackPlugin({
      template: join(process.cwd(), 'tests', 'fixtures', 'index.html'),
    }),
  ],
}

for customized exported(re-exported) styled

interface CustomModule {
  // module name used in import statement
  moduleName: string
  // `true` if you may import libs from 'my-emotion/subpath'
  includesSubPath?: boolean
  // all available names exported from custom module
  exportedNames: string[]
  // we may do some additional work on styled function, so if styled is reexport, you should specify it here
  styledName?: string
  // has default export
  hasDefaultExport?: boolean
}

createEmotionPlugin({
  ...otherConfig,
  customModules: [
    {
      moduleName: 'my-emotion',
      includesSubPath: true,
      exportedNames: ['myStyled', 'myCss']
      styledName: 'myStyled',
    }
  ]
})
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].