webpack에서 Bulma를 사용하고 싶습니다.

8998 단어 Bulmawebpack
공식 에 정중하게 정리되어 있었습니다

필요한 로더 등의 설치

npm install --save-dev css-loader node-sass sass-loader style-loader bulma 설치 npm install --save-dev bulma webpack.config.js 편집 rules는 bootstrap의 것이 도움이되었습니다. 여기

webpack.config.js

  entry: {
    use_bulma: './assets/scss/use_bulma.scss',
  },
...
        rules: [
      {
        test: /\.(scss)$/,
        use: [
        {
          loader: 'style-loader',
        }, {
          loader: 'css-loader',
        }, {
          loader: 'postcss-loader',
          options: {
            plugins: function () {
              return [
                require('precss'),
                require('autoprefixer')
              ];
            }
          }
        }, {
          loader: 'sass-loader',
        },
        ]
      }
...



assets/scss/use_bulma.scss
@charset "utf-8";

@import url('https://fonts.googleapis.com/css?family=Nunito:400,700');

// Set your brand colors
$purple: #8A4D76;
$pink: #FA7C91;
$brown: #757763;
$beige-light: #D0D1CD;
$beige-lighter: #EFF0EB;

// Update Bulma's global variables
$family-sans-serif: "Nunito", sans-serif;
$grey-dark: $brown;
$grey-light: $beige-light;
$primary: $purple;
$link: $pink;
$widescreen-enabled: false;
$fullhd-enabled: false;

// Update some of Bulma's component variables
$body-background-color: $beige-lighter;
$control-border-width: 2px;
$input-border-color: transparent;
$input-shadow: none;

@import "~bulma/bulma";
<h1 class="title">
  Bulma
</h1>

<p class="subtitle">
Modern CSS framework based on <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox">Flexbox</a>
</p>

<div class="field">
  <div class="control">
    <input class="input" type="text" placeholder="Input">
  </div>
</div>

<div class="field">
  <p class="control">
  <span class="select">
    <select>
      <option>Select dropdown</option>
    </select>
  </span>
  </p>
</div>

<div class="buttons">
  <a class="button is-primary">Primary</a>
  <a class="button is-link">Link</a>
</div>



장고로 움직이면



여기 참조

좋은 웹페이지 즐겨찾기