当我尝试像这样从 App.js 导入 styles.css
import React from 'react';
import {render} from 'react-dom';
import * as PropTypes from 'prop-types';
import {AppProvider, Page, Card, Button} from '@shopify/polaris';
import '@shopify/polaris/styles.css'; // << issue
import SettingsForm from './SettingsForm';
class App extends React.Component {
static contextTypes = {
easdk: PropTypes.object,
};
render() {
return (
<AppProvider>
<Page title="Settings">
<SettingsForm />
</Page>
</AppProvider>
);
}
}
export default App;
我收到一个错误:编译失败
./node_modules/@shopify/polaris/styles.css (./node_modules/css-loader??ref--6-oneOf-3-1!./node_modules/postcss-loader/src??postcss!./node_modules/@shopify/polaris/styles.css)
Unclosed bracket (3864:37)
3862 | background-color:#c4cdd5;
3863 | background-color:var(--progress-upper, #c4cdd5);
> 3864 | background-image:linear-gradient(to right, transparent 0%, transparent 0%, transparent 100%, transparent 100% transparent;
| ^
3865 | background-image:linear-gradient(to right, var(--progress-lower, transparent) 0%, var(--progress-lower, transparent) var(--Polaris-RangeSlider-progress, 0%), var(--progress-upper, transparent) var(--Polaris-RangeSlider-progress, 100%), var(--progress-upper, transparent) 100%);
3866 | border:none;
我验证了里面的css node_modules/@shopify/polaris/styles.css
是一样的https://sdks.shopifycdn.com/polaris/2.12.1/polaris.css
我对该行进行了全局搜索,background-image:linear-gradient(to right, transparent 0%, transparent 0%, transparent 100%, transparent 100% transparent;
但结果为 0
为什么我在这里遇到错误,请问我该如何克服这个问题?谢谢你。