grid
Component
grid
component is vital for organizing HTML elements horizontally. Without
grid
, every contents are arranged vertically with 100% width as default.
Bissetii uses the CSS Flexbox to perform its dynamic wrapping and the latest can
now work without hard-coded mathematics (e.g. 12 columns or fixed percent).
This component is available starting from v1.11.0
.
Example usage:
|
|
Hugo
Bissetii supports Hugo interfaces to make content creation easier depending on Bissetii version.
Shortcodes
Bissetii prepared a list of shortcodes to make website creation a lot easier.
Here are some of the available shortcodes related to Grid
component.
grid
Shortcode
The grid
shortcode allows you to create a .row
or a .column
containers
easily when using Bissetii in Hugo.
This shortcode is available starting from version v1.13.1
.
The format is as follows:
|
|
TYPE
- COMPULSORY- Denotes the sub-component. Either
"row"
or"column"
.
- Denotes the sub-component. Either
STYLE
- OPTIONAL- The
style=
attribute for the sub-component.
- The
CLASS
- OPTIONAL- The
class=
attribute for the sub-component.
- The
ID
- OPTIONAL- The
id=
attribute for the sub-component.
- The
CONTENT
- COMPULSORY- The content inside the sub-component.
To use it, simply call it inside the markdown. Example:
|
|
Go
Coming Soon.
HTML
Bissetii supports its grid system seamlessly and similarly in multiple output
formats. Additionally, starting from version v1.13.0
, the use of CSS variables
is vital for its upgrade from v1.12.5
.
Bissetii HTML codes are the same for Vanilla HTML5 and AMPHTML. The grid system
takes in the form of .row
and multiple .column
s using <div>
HTML tag. Here
is the main pattern:
|
|
There is no limit for how many .column
in a .row
as long as it is sensible.
The rest of the customizations are depending on the Bissetii version.
Quantified Re-Sizing
To keep things familar across Bissetii’s competitors, Bissetii supplies the porpotional sizing for columns.
Version 1.13.0
and Above
Bissetii uses simple multiplication to provide the column’s BASE
width and
its MULTIPLIER
using the following formula:
flex-grow: calc(BASE * MULTIPLIER);
Where:
BASE
must be the same across all columns in a.row
BASE
>MULTIPLIER
- Default
BASE
=10
- Default
MULTIPLIER
=1
- If the total width is not permittable (e.g. hitting max width of a
.row
), the growth and shrink will be halted all together.
via the following CSS variables (see CSS section for more info):
--grid-column-base: 10; /* BASE - set at .row */
--grid-column-multiplier: 1; /* MULTIPLIER - set at .column */
The HTML pattern is as such:
|
|
As an example, the above will render as the following:
B = default | M = default
B = default | M = default
B = default | M = default
B = default | M = 2
B = default | M = default
B = default | M = 3
B = default | M = 3
B = default | M = 2
Version 1.12.5
And Below
Bissetii uses a constant 10
as BASE
value and supplies grid-2x
, grid-3x
,
… up to grid-10x
as their respective MULTIPLIER.
Here is an example of the HTML code:
|
|
Hide a Column
Bissetii allows a column to remain hidden at will. The implementation depends on which version you deployed.
Version 1.13.0
and Above
To hide a .column
, simply set the --grid-column-visibility: hidden;
onto
that column’s inline CSS style. Example:
|
|
This will render as:
Column 1
Column 3
Version 1.12.5
and Below
For version 1.12.5
and below, apply .offset
class tag to the column.
Example:
|
|
Align Vertically
Bissetii grid system permits vertical alignment for all columns' content in the
entire row using the Flexbox’s align-items:
CSS field. Depending on Bissetii’s
version, the implementation can be done differently.
Version 1.13.0
and Above
To set the column’s content vertical alignment, set the --grid-align-items
CSS variable provided by Bissetii at the .row
container. For more info about
--grid-align-items
, please see the CSS section. Here is the HTML code pattern:
|
|
This will render as such:
center
center
center
center
center
center
center
center
center
Version 1.12.5
and Below
For version 1.12.5
and below, apply .align-[DIRECTION]
class tags to the
column.
Example:
|
|
CSS
Bissetii provided a list of CSS variables dedicated for grid styling alteration without needing to recompile Sass. These variables are best applied directly to the Grid HTML tags. Example:
|
|
--grid-width
Set the width of the column. The acceptable value shall be compatible with
width:
CSS fields. The default value is 100%
.
--grid-justify-content
Set the spacing between the columns. The acceptable value shall be compatible
with justify-content:
CSS field. The default value is space-around
.
--grid-align-items
Set the alignment of the columns. The acceptable value shall be compatible
with align-items:
CSS field. The default value is stretch
.
--grid-flex-wrap
Set the flex wrapping for all the columns. The acceptable value shall be
compatible with flex-wrap:
CSS field. The default value is wrap
.
--grid-column-display
Set the display type for the column. The acceptable value shall be compatible
with display:
CSS field. The default value is block
.
--grid-column-max-width
Set the column’s max width. The acceptable value shall be compatible with
max-width:
CSS field. The default value is 100%
.
--grid-column-margin
Set the column’s margin. The acceptable value shall be compatible with margin:
CSS field. The default value is .3rem
.
--grid-column-padding
Set the column’s padding. The acceptable value shall be compatible with
padding:
CSS field. The default value is 0
.
This is only available for Bissetii version v1.13.1
and above.
--grid-column-visibility
Set the column’s visibility. The acceptable value shall be compatible with
visibility:
CSS field. The default value is visible
.
--grid-column-base
Set the total columns in a row as base number. The acceptable value shall be
a round number compatible for calc()
CSS input calculations function. The
default is 10
.
--grid-column-multiplier
Set the column width to the multiplication of --grid-column-base
. The
acceptable value shall be a round number compatible for calc()
CSS input
calculations function. The default is 1
.
--grid-column-flex-basis
Set the column flexibility to responsive screen. The acceptable value shall be
compatible with flex-basis:
CSS field. The default is auto
.
Javascript
This component does not depend any Javascript.
Sass
Depending on release version, the Sass files work differently. Bissetii does not package Sass codes explictly so please view them via the git repository.
v1.13.0
and Above
Bissetii uses Dart Sass to compile the styling Sass codes into CSS file. This component’s Sass codes are available at the following location:
pkg/components/internal/image
v1.12.5
and Before
The Sass scripts responsible for styling image are located at:
assets/css/bissetii/modules/core/_Grid.scss
Researches
Here are the researches done to ensure Grid
component meets the necessary
quality assurances:
SCHEDULED COMING SOON
Epilogue
That’s all about grid
component in Bissetii. If you need more feature or
need to report a bug, please feel free to file an issue at our
Issue Section.