npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@sb1/ffe-grid

v14.2.12

Published

A grid component for use within the FFE framework

Downloads

776

Readme

@sb1/ffe-grid

A 12-column grid you can use to visually structure your UIs.

Installation

npm install --save @sb1/ffe-core @sb1/ffe-grid

Remember to include the less-file in your main less-file:

@import '~@sb1/ffe-grid/less/ffe-grid';

Usage

Full documentation on grid usage is available at https://design.sparebank1.no/komponenter/grid/.

See also @sb1/ffe-grid-react.

All you need to remember is .ffe-grid, .ffe-grid__row and .ffe-grid__col.

The .ffe-grid-col class has a few modifiers that specify how large it should be at a given viewport size, and if it should be offset.

Note

There should be no more than four columns on small devices and six columns on medium ones. Although it's technically possible, it's not something that's encouraged by the designers.

Width

The pattern is like so: ffe-grid__col--{size}-{num-of-cols}

It's easier to explain with an example:

<div class="ffe-grid">
    <div class="ffe-grid__row">
        <div
            class="
            ffe-grid__col--sm-12
            ffe-grid__col--md-6
            ffe-grid__col--lg-3
        "
        >
            <!-- content -->
        </div>
    </div>
</div>

This column will be 100 % (12 columns) for small screens, 50 % (6 columns) for medium screens and 25 % (3 columns) for large screens.

You only have to specify one of these if you want - each column defaults to a 100 % width for viewports that are not specified (i.e. .ffe-grid__col--md-6 will be 100 % wide on small devices, and 50 % on medium and large screens).

A column can be hidden entirely on a given breakpoint by setting the value to 0, e.g. .ffe-grid__col--sm-0 to hide it on small screens.

Offset

The pattern is like so: .ffe-grid__col--{size}-offset-{num-of-cols}

The offsets work in a similar fashion to the width specification modifiers. Each breakpoint can have its own offset if needed.

Margin and padding

Margin and padding in the top and bottom of grid rows can be applied using the margin and padding modifiers:

.ffe-grid__row--padding-{size} .ffe-grid__row--margin-{size}

Available sizes correspond to the ffe spacing variables. For example, the required modifier to add a 4xl (80px) margin to a row is ffe-grid__row-padding-4xl.

By default, rows have no padding or margin.

Gap

The gutter/gap between columns can be controlled using the .ffe-grid--gap-{size} modifier. Available sizes correspond to the ffe spacing variables, however the largest available size is lg.

The default gap is 16px, equivalent to .ffe-grid--gap-sm.

The gap value is also applied as a padding to the left and right of the grid.

Center

Contents of a grid column can be centered horizontally and vertically using the .ffe-grid__col--center modifier.

Center text

Text inside a grid column can be centered using the .ffe-grid__col--center-text modifier.

Background colors

The background color of rows can be changed using modifiers. This requires that the children of .ffe-grid__row are wrapped in .ffe-grid__row-wrapper.

<div class="ffe-grid__row ffe-grid__row--bg-sand">
    <div class="ffe-grid__row-wrapper">
        <div class="ffe-grid__col--md-6">
            <!-- content -->
        </div>
        <div class="ffe-grid__col--md-6">
            <!-- content -->
        </div>
    </div>
</div>

.ffe-grid__row--bg-frost-30

Sets the row background color to @ffe-farge-frost-30

.ffe-grid__row--bg-sand

Sets the row background color to @ffe-farge-sand

.ffe-grid__row--bg-sand-70

Sets the row background color to @ffe-farge-sand-70

.ffe-grid__row--bg-sand-30

Sets the row background color to @ffe-farge-sand-30

.ffe-grid__row--bg-syrin-70

Sets the row background color to @ffe-farge-syrin-70

.ffe-grid__row--bg-syrin-30

Sets the row background color to @ffe-farge-syrin-30

.ffe-grid__row--bg-vann

Sets the row background color to @ffe-farge-vann

.ffe-grid__row--bg-vann-30

Sets the row background color to @ffe-farge-vann-30

.ffe-grid__row--bg-fjell

Sets the row background color to @ffe-farge-fjell

.ffe-grid__row--bg-hvit

Sets the row background color to @ffe-farge-hvit

Development

To start a local development server, run the following from the designsystem root folder:

npm install
npm run build
npm start

A local instance of component-overview with live reloading will run at http://localhost:1234/.

Example implementations using the latest versions of all components are also available at https://sparebank1.github.io/designsystem.