mit Ich mag würde twitter-bootstrap
mit inline-styles
, verwenden, um so zu tun, ich habe ein Setup:Kann nicht Variablen oder Mixins laden Inline-style-loader
{
test: /\.scss$/,
loaders: ['raw', 'inline-style', 'autoprefixer?' + autoprefixerOptions, 'sass']
}
habe ich installiert bootstrap-sass
und radium
npm verwenden. Ich schrieb diesen Code:
import normalize from 'radium-normalize'
import m from '../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/_mixins.scss'
import v from '../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/_variables.scss'
import sc from '../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/_scaffolding.scss'
import t from '../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/_type.scss'
import buttons from '..//node_modules/bootstrap-sass/assets/stylesheets/bootstrap/_buttons.scss'
ich diese an die Style
Komponente von radium
wie dies vorgesehen ist hinzuzufügen versuchen:
const baseRules = {...normalize, ...m, ...v, ...sc, ...type}
const App =() => (
<div>
<Style rules={baseRules} />
<HelloWorld />
</div>
)
ich diese Fehler mich darüber informiert, dass Variablen und Mixins wurden nicht definiert:
ERROR in ./~/bootstrap-sass/assets/stylesheets/bootstrap/_scaffolding.scss
Module build failed:
@include box-sizing(border-box);
^
No mixin named box-sizing
Backtrace:
stdin:12
in /home/vamsi/Do/webpack-npm-plugin/node_modules/bootstrap-sass/assets/stylesheets/bootstrap/_scaffolding.scss (line 12, column 12)
@ ./src/index.js 21:19-107
ERROR in ./~/bootstrap-sass/assets/stylesheets/bootstrap/_type.scss
Module build failed:
font-family: $headings-font-family;
^
Undefined variable: "$headings-font-family".
in /home/vamsi/Do/webpack-npm-plugin/node_modules/bootstrap-sass/assets/stylesheets/bootstrap/_type.scss (line 11, column 16)
@ ./src/index.js 25:12-93
ERROR in ./~/bootstrap-sass/assets/stylesheets/bootstrap/_buttons.scss
Module build failed:
font-weight: $btn-font-weight;
^
Undefined variable: "$btn-font-weight".
in /home/vamsi/Do/webpack-npm-plugin/node_modules/bootstrap-sass/assets/stylesheets/bootstrap/_buttons.scss (line 12, column 16)
@ ./src/index.js 29:15-100
Der Inline-Style-Loader ist die falsche Sache zu verwenden, wandelt sie die Stile für die Verwendung mit dom-Elemente müsste ich dann in Javascript-Objekte konvertieren. Ich würde gerne verstehen, wie ich von etwas wie Twitter Bootstrap weniger/sass nehmen und es für die Verwendung mit Radium kompilieren kann. Der Radium-Lader wirft einen Fehler für mich auf. – vamsiampolu