We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import React from 'react'; import Button from 'antd/lib/button'; import styled from "styled-components"; const StyledButton = styled(Button)` color: palevioletred; font-weight: normal; :focus { color: palevioletred; border-color: palevioletred; } :hover { color: palevioletred; border-color: palevioletred; } &.ant-btn-clicked:after { content: ''; position: absolute; top: -1px; left: -1px; bottom: -1px; right: -1px; border-radius: inherit; border: 0 solid palevioletred; opacity: 0.4; -webkit-animation: buttonEffect 0.4s; animation: buttonEffect 0.4s; display: block; } `;
typescript-plugin-styled-components is a plugin for TypeScript that gives you a nicer debugging experience
// 1. import default from the plugin module const createStyledComponentsTransformer = require('typescript-plugin-styled-components').default; // 2. create a transformer; // the factory additionally accepts an options object which described below const styledComponentsTransformer = createStyledComponentsTransformer({ displayName: true}); // 3. add getCustomTransformer method to the loader config var config = { ... module: { rules: [ { test: /\.tsx?$/, loader: 'ts-loader', options: { ... // other loader's options getCustomTransformers: () => ({ before: [styledComponentsTransformer] }) } } ] } ... }; interface Options { getDisplayName(filename: string, bindingName: string | undefined): string | undefined; identifiers: CustomStyledIdentifiers; ssr: boolean; displayName: boolean; minify: boolean; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
typescript-plugin-styled-components is a plugin for TypeScript that gives you a nicer debugging experience
The text was updated successfully, but these errors were encountered: