Book Image

Creating Interfaces with Bulma

By : Jeremy Thomas, Oleksii Potiekhin, Mikko Lauhakari, Aslam Shah, Dave Berning
Book Image

Creating Interfaces with Bulma

By: Jeremy Thomas, Oleksii Potiekhin, Mikko Lauhakari, Aslam Shah, Dave Berning

Overview of this book

Bulma is a lightweight configurable CSS framework that handles all the hard work of Flexbox for you. Bulma makes creating web interfaces an easy and interesting job. This book begins with an overview of the basics of Bulma ? its terms and its concepts. Then, while designing a login page for your application, you’ll learn how to use the various tools provided by Bulma to create HTML forms and control their layout and flow. In the later chapters, you’ll design an admin area for your application, thus learning to use Bulma’s navigation and menu components. You will also add the components to your user interface for common things such as boxes, lists, and media groups, and then create pagination. As you progress through the book, you’ll create and layout some other components for your interface, including tables, design dropdown lists, and finally to integrate your web application with JavaScript. By the end of this book, you’ll be able to use the features of Bulma to your advantage and build web interfaces quickly and easily.
Table of Contents (15 chapters)
8
8. Creating more tables and selecting dropdowns

Custom rules

Because Bulma is written in Sass, you can use all of the language’s features:

  • variables
  • nesting
  • mixins
  • extends

You have already used new variables. To customize the design even more, you can use extends and nesting.

All of the code from now on has to be written at the end of the file, after having imported Bulma.

Second font

Bulma doesn’t have a second font family. So you have to write your own CSS rules. Luckily, the classes are easy to extend.

After @import "node_modules/bulma/bulma";, write the following:

%heading {
  font-family: $family-heading;
  font-weight: 500;
}

This is a Sass placeholder: this allows you to combine multiple selectors into a single rule.

Bigger controls

The Bulma controls (buttons, inputs, select dropdown, pagination links...) are redefined in this new design: slightly bigger, with no inner shadow or border.

The new control size will be re-used a few times, so it’s better to define a new variable:

$control...