Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
0
Help us understand the problem. What is going on with this article?
@gsk3beta

webpackでBulmaを使いたい

More than 1 year has passed since last update.

公式に丁寧にまとめられていました

必要なローダー等のインストール

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>

bulma.png

djangoで動かすなら

こちらもご覧ください

0
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
gsk3beta

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
0
Help us understand the problem. What is going on with this article?