Getting Started
Source: materials/getting-started.mdQuick start
Add the following stylesheet <link>
to your <head>
before all other stylesheets.
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/project-fast@2.0.0-beta.2/dist/css/style.css">
Add the following script
before the the closing </body>
tag. No jQuery required!
<script src="https://cdn.jsdelivr.net/npm/project-fast@2.0.0-beta.2/dist/js/bundle.js"></script>
<script src="https://cdn.jsdelivr.net/npm/project-fast@2.0.0-beta.2/dist/js/app.min.js"></script>
How to install
NPM
npm install project-fast
Yarn
yarn add project-fast
Add the following code to webpack.mix.js
:
mix.js('resources/js/app.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css');
And resources/sass/app.scss
:
// Variables
@import "variables";
// Project FAST
@import '~project-fast/src/scss/includes.scss';
Add the following code to resources/js/app.js
:
import Fast from 'project-fast';
Variables
Source: materials/general/variables.md$color-primary: #F37748 !default;
$color-secondary: #696969 !default;
$color-base-white: #fff !default;
$color-base-light: #ededed !default;
$color-base-black: #000 !default;
$color-text: #333 !default;
$color-link: #007bff !default;
$color-icon: #6d6d6d !default;
$color-button: $color-primary !default;
$color-button-text: $color-base-white !default;
$color-table: $color-base-white !default;
$color-table-border: #e0e0e0 !default;
$color-table-text: $color-base-black !default;
$color-table-selection: rgba($color-primary, 0.22) !default;
$color-checkbox-active: $color-primary !default;
$color-checkbox-inactive: #757575 !default;
$color-checkbox-check: $color-base-white !default;
$color-radio-active: $color-primary !default;
$color-radio-inactive: #757575 !default;
$color-text-field-label: rgba($color-base-black, 0.54) !default;
$color-text-field-inactive: #8a8a8a !default;
$color-text-field-active: $color-primary !default;
$color-fill-field: darken($color-base-white, 6%) !default;
$color-field-helper: rgba($color-base-black, 0.54) !default;
$color-field-error: #f44336 !default;
$color-form: $color-base-white !default;
$color-pagination: $color-primary !default;
$color-pagination-text: $color-base-white !default;
$color-fab: $color-primary !default;
$color-fab-text: $color-base-white !default;
$color-card: $color-base-white !default;
$color-card-title: $color-base-black !default;
$color-card-text: rgba($color-base-black,.54) !default;
$color-expansion-panel: $color-base-white !default;
$color-expansion-panel-text: rgba($color-base-black,.54) !default;
$color-app-bar: $color-primary !default;
$color-app-bar-text: $color-base-white !default;
$color-drawer: $color-base-white !default;
$color-drawer-text: rgba($color-base-black, .87) !default;
$color-drawer-header: $color-primary !default;
$color-drawer-header-text: $color-base-white !default;
$color-drawer-border: #e0e0e0 !default;
$color-facebook: #3b5998 !default;
$color-youtube: #e52d27 !default;
$color-twitter: #55acee !default;
$color-success: #28a745 !default;
$color-error: #f44336 !default;
$drawer-image: "../img/logo.svg" !default;
$drawer-background: url($drawer-image) no-repeat center bottom 50px / auto calc(100% - 65px) !default;
$border-radius: .8rem !default;
$login-image: "https://picsum.photos/1920/1080/?blur&random" !default;
$margin-size: 3rem !default;
App Bar
Source: materials/components/app-bar.mdRequired
Default
Prominent
Dense
Fixed
Variables
@use "setup/variables" with (
$app-bar: (
"background": $color-primary,
"color": $color-base-white,
"padding": .8rem 1.2rem,
"height": 6.2rem,
"title": (
"font-size": 2rem,
),
"prominent": (
"height": 12.8rem,
),
"dense": (
"height": 5.4rem,
"padding": .2rem .4rem,
),
"icon": (
"font-size": 2.4rem,
),
),
);
Cards
Source: materials/components/cards.mdAdd a grid column class like .col__sm--6
to the card to change size. Image is optional.
Variables
@use "setup/variables" with (
$card: (
"background": $color-base-white,
"color": rgba($color-base-black,.54),
"font-size": 1.4rem,
"padding": 1.6rem,
"title": (
"color": $color-base-black,
"font-size": 2rem,
),
"subtitle": (
"color": rgba($color-base-black, .65),
"font-size": 1.4rem,
),
"button": (
"color": rgba($color-base-black, .65),
"font-size": 1.8rem,
),
),
);
Dialog
Source: materials/components/dialog.mdDrawer
Source: materials/components/drawer.mdRequired
The header image can be changed with the SASS variable: $drawer-image
. If you want a dark drawer add the class drawer--dark
to the drawer__drawer
element.
Compact
Temporary
Persistent
The drawer will change to temporary on mobile
Permanent
The drawer will change to temporary on mobile
Variables
@use "setup/variables" with (
$drawer: (
"background": $color-base-white,
"color": rgba($color-base-black, .87),
"border": #e0e0e0,
"width": 32rem,
"image": "/src/assets/img/logo.svg",
"header": (
"background": $color-primary,
"color": $color-base-white,
"height": 13.5rem,
"image": url("/src/assets/img/logo.svg") no-repeat center bottom 5rem / auto calc(100% - 6.5rem),
"padding": 1.6rem,
),
"compact": (
"width": 24rem,
"header": (
"height": 6.2rem,
"padding": .8rem 1.6rem,
),
),
"dark": (
"background": $color-secondary,
"color": $color-base-white,
),
"list": (
"font-size": 1.4rem,
),
),
);
Expansion panel
Source: materials/components/expansion-panel.mdVariables
@use "setup/variables" with (
$expansion-panel: (
"background": $color-base-white,
"color": rgba($color-base-black,.54),
)
);
List
Source: materials/components/list.mdSingle-Line
Striped
Compact
Two-Line
Leading icon
Trailing icon
Variables
@use "setup/variables" with (
$list: (
"background": $color-base-white,
"border": #e0e0e0,
"color": rgba($color-base-black, .87),
"font-size": 1.6rem,
"height": 4.8rem,
"padding": 1.5rem 1.6rem,
"compact": (
"font-size": 1.4rem,
"height": 3.6rem,
),
"secondary": (
"color": rgba($color-base-black, .54),
"font-size": 1.4rem,
),
"graphic": (
"color": rgba($color-base-black, .38),
"font-size": 2.4rem,
"size": 2.4rem,
),
"meta": (
"color": rgba($color-base-black, .38),
"font-size": 2.4rem,
),
"divider": rgba($color-base-black, .12),
)
);
Login
Source: materials/components/login.mdPagination
Source: materials/components/pagination.mdVariables
@use "setup/variables" with (
$pagination: (
"background": $color-primary,
"border-radius": .225em,
"color": $color-base-white,
"color-nav": $color-base-black,
"font-size": 1.4rem,
"width": 3.571em,
"height": 2.575em,
)
);
Snackbar
Source: materials/components/snackbar.mdRequired
Vanilla JS
new Snackbar("Hey! Im a snackbar");
// Snackbar(message, options, callback)
or HTML
<span data-toggle=snackbar data-content="Hey! Im a snackbar">Click me</span>
or Vue.js
Vue.use(fastSnackbar);
this.$snackbar.create("Vuejs is awesome!", {}, function(){});
Tables
Source: materials/components/tables.mdSimple
Compact
Striped
Data table
Also usable with table--compact
Helper classes
The following classes can be added to the <table>
:.table--layout-fixed
for table-layout: fixed..table--fullwidth
for 100% width..table--scroll-horizontal
for horizontal scrolling if the table is too big..table--fit
for making the content fit on one line. (If you have set widths to columns)
.table--responsive
for change the table to a vertical view on mobile.
Variables
@use "setup/variables" with (
$table: (
"background": $color-base-white,
"border": #e0e0e0,
"color": $color-base-black,
"font-size": 1.3rem,
"padding": .4rem 5.6rem .4rem 2.4rem,
"height": 5.6rem,
"head": (
"font-size": 1.2rem,
"color": rgba($color-base-black, .54),
),
"foot": (
"font-size": 1.2rem,
),
"compact": (
"height": 4.4rem,
"padding": .4rem 0 .4rem 2.4rem,
),
"data-table": (
"selection": $color-primary,
"action": $color-primary,
),
"responsive": (
"head-width": 35%,
"body-width": 65%,
"height": 3.9rem,
"padding": .8rem 1.8rem,
),
),
);
Tabs
Source: materials/components/tabs.mdVariables
@use "setup/variables" with (
$tab: (
"label": (
"border": #e0e0e0,
"border-active": $color-primary,
),
"border": $color-primary,
"chip": (
"background": $color-primary,
"color": $color-base-white,
"font-size": 1.4rem,
),
),
);
Chips
Source: materials/elements/chips.mdLeading icon
Filter
Variables
@use "setup/variables" with (
$chip: (
"background": #e0e0e0,
"background-primary": $color-primary,
"border-radius": 1.2em,
"color": rgba($color-base-black, .87),
"color-primary": $color-base-white,
"font-size": 1.4rem,
"padding": .5em .857em,
"height": 2em,
"icon-font-size": 1.6rem,
)
);
Headings
Source: materials/elements/headings.mdAvailable headings
Variables
@use "setup/variables" with (
$headings: (
"color": #212529,
"h1": 4.2rem,
"h2": 3.4rem,
"h3": 2.8rem,
"h4": 2.2rem,
"h5": 1.8rem,
"h6": 1.6rem,
)
);
Icons
Source: materials/elements/icons.mdCheckbox
Source: materials/forms/checkbox.mdVariables
@use "setup/variables" with (
$checkbox: (
"size": 1.6rem,
"active": $color-primary,
"inactive": #757575,
"check": $color-base-white,
)
);
Forms
Source: materials/forms/forms.mdForm classes
Fixed form sizes:
form--s
400px,
form--m
800px,
form--l
1200px
To wrap it around a card:
form--card
Inline:
form--inline
To limit a form submit trigger, add: form--submit-limit
and
Variables
@use "setup/variables" with (
$form: (
"background": $color-base-white,
"sizes": (
"s": 40rem,
"m": 80rem,
"l": 120rem,
),
)
);
Switch
Source: materials/forms/switch.mdVariables
@use "setup/variables" with (
$switch: (
"size": 1.6rem,
"active": $color-primary,
"inactive": #fafafa,
)
);
Text fields
Source: materials/forms/text-fields.mdField styles
Text field
Number field
Password field
Textarea field
Prefix & Suffix
Helper text
Field error
Variables
@use "setup/variables" with (
$input-field: (
"font-size": 1.6rem,
"label": rgba($color-base-black, .54),
"inactive": #8a8a8a,
"active": $color-primary,
"fill": darken($color-base-white, 6%),
"helper": rgba($color-base-black, 0.54),
"error": #f44336,
"disabled": (
"background": #f9f9f9,
"color": lighten($color-text, 30%),
),
)
);
Upload field
Source: materials/forms/upload-field.mdContainer
Source: materials/layout/container.mdGrid
Source: materials/layout/grid.mdCan be used to override the default sizes of molecules.
Available breakpoints: mob, tab, desk
Grid columns
Creates a grid column of requested size.
Grid shift
Shift columns and reorder them within their container using relative positioning.
Variables
@use "setup/variables" with (
// desktop grid
$grid-desktop-columns: 12;
$grid-desktop-sideMargin: 40px;
$grid-desktop-gutter: 20px;
$grid-desktop-breakpoint: $screen-xl;
// tablet grid
$grid-tablet-columns: 12;
$grid-tablet-sideMargin: 40px;
$grid-tablet-gutter: 20px;
$grid-tablet-breakpoint: $screen-lg-max;
// mobile grid
$grid-mobile-columns: 4;
$grid-mobile-sideMargin: 32px;
$grid-mobile-gutter: 20px;
$grid-mobile-breakpoint: $screen-sm-max;
);
Main
Source: materials/layout/main.mdUtilities
Source: materials/utilities/utilities.mdText alignment
Element alignment
Background color
Text color
Margin
Hidden
To hide an element, use the class hidden
. Add a modifier --xs
--sm
--md
--lg
to activate it until a specific breakpoint.
Visible
To make an element visible, use the class visible
. Add a modifier --xs
--sm
--md
--lg
to activate it until a specific breakpoint.
Variables
$margin-size: 30px !default;