question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

css file modularize

See original GitHub issue

antd

src
├── README.md
├── components
│   ├──button
│            ├── style
│                      ├── index.js
│                      ├── index.less
│            ├── index.js
│   ├──dropdown
│            ├── style
│                      ├── index.js
│                      ├── index.less
│            ├── index.js
├── style
│   ├──index.js
│   ├──index.less
│   ├──effect.less
│   ├──variable.less
│   ├──mixin.less

style/index.js

import 'normalize.css';
import './index.less'

button/style/index.less

@import '../../style/variable.less';
@import "../../style/mixin.less";
// button' less

button/style/index.js

import "./index.less";

dropdown/style/index.less

@import '../../style/variable.less';
@import "../../style/mixin.less";
// dropdown' less

dropdown/style/index.js

import "../../button/style";
import "./index.less";

publish antd

├── lib
│   ├──button
│            ├── style
│                      ├── index.js
│                      ├── css.js
│                      ├── index.less
│                      ├── index.css
│            ├── index.js
├── style
│   ├──css.js
│   ├──index.css
│   ├──index.js
│   ├──index.less
│   ├──effect.less
│   ├──variable.less
│   ├──mixin.less

style/css.js

require('./index.css');

lib/button/style/css.js

require('./index.css');

using antd

source

entry

import 'antd/style';

component A

import {dropdown} from 'antd';

compile using babel-antd

entry

require('antd/style');

component A

var Dropdown = require('ant/lib/dropdown');
require('antd/lib/dropdown/style')

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:3
  • Comments:18 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
shenglianglicommented, May 15, 2016

babel-plugin-antd折腾了一天还是不行,唉,东西是好东西,可惜文档太差!

0reactions
lock[bot]commented, May 5, 2018

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is Modular CSS? - Space Ninja
Modular CSS simplifies code and facilitates refactoring. It produces self-documenting code. It results in reusable code that doesn't influence ...
Read more >
What are CSS Modules and why do we need them?
According to the repo, CSS modules are: CSS files in which all class names and animation names are scoped locally by default. So...
Read more >
A Quick Guide To Modular CSS – Don't Be Petty, Write Less ...
The idea behind modular CSS is to write specific styles that serve a single purpose within a given scope with less general classes...
Read more >
Modularizing CSS files - Stack Overflow
The best solution is to write a script that combines (and minifies) multiple CSS or JS files.
Read more >
30 Second Overviews of 4 Modular CSS Approaches
Modular CSS is approach of breaking down webpage styling into smaller independent components that are consistent, reusable and hold on to its ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found