1.1.14 • Published 2 years ago

alabaster v1.1.14

Weekly downloads
738
License
MIT
Repository
github
Last release
2 years ago

Alabaster

A lightweight and flexible tool set to build awesome web platform.

Alabaster is a sass tool sets develop to build awesome web site faster and easy. It's build especially on how we develop the frontend in Axiacore.

What you would find

We use a concept call modular scale to keep the vertical rhythm and consistency in our design. We develop some mixin so we can layout the design easy and faster.

You are going to find some helpers so you can write smooth Sass.

Quick install

Alabaster is constantly in development.

Yarn

yarn add alabaster

or

NPM

npm i alabaster

Usage

Call the file alabaster.sass in the file that compile your Sass and be sure you call it before the Sass's files you use to build your web.

@import 'route-to-file/alabaster.sass'
@import 'header'

You can change the variables default value, by calling them before you call the alabaster.sass file and add !default to the end of the line.

$ratio: 1.333 !default

@import 'route-to-file/alabaster.sass'
@import 'header'

Modular scale

Used to keep the vertical rhythm and consistency in our design.

Variables
NameDefaultDescription
$base-font-size100Font size for mobile in %
$base-font-size-tablet112.5Font size for tablet and above in %
$line-height1.45Line height fonts for mobile
$line-height-tablet1.7Line height fonts tablet and above
$ratio1.5Is multiplied by the base to produce the scale of numbers that are related

Sass functions:

ms(value) Returns a value in rem for the font size based in the modular scale.

dms-rem-mobile(value) Returns a value in rem for distances in mobile.

dms-rem-tablet(value) Returns a value in rem for distances in tablet and above.

dms-px-mobile(value) Returns a value in px for distances in mobile.

dms-px-tablet(value) Returns a value in px for distances in tablet and above.

Responsive breakpoints

Alabaster is developed to be mobile first, we use media queries to create breakpoints for layouts. These breakpoints are based on minimum viewport widths and allow to scale up elements as the viewport changes.

Variables
NameDefaultDescription
$mobile500pxMedia query breakpoint for 500px and above
$tablet768pxMedia query breakpoint for 500px and above
$desktop994pxMedia query breakpoint for 994px and above
$desktop-md1200pxMedia query breakpoint for 1200px and above
$desktop-lg1400pxMedia query breakpoint for 1400px and above

Example:

@include breakpoint($tablet)
	code here...

Components

Alabaster includes the following components:

Wrapper container

The .wrapper-container class is used to wrap all page content and give it a max width. It is used to preserve the design in very large screens.

Variables
NameDefaultDescription
$wrapper-container-max-width1920pxMax width of the container in px
$wrapper-container-shadow0 0 30px -15px rgba(0, 0, 0, 1)Box shadow of the container
$wrapper-background-colorwhiteBackground color of the container

Example:

<body>
	<div class="wrapper-container">
		...
	</div>
</body>

Container

The .container class is used to center content horizontally.

Variables
NameDefaultDescription
$container-max-width1230pxMax width of the container in px
$container-xs-max-width370pxMax width of the extra small container in px
$container-sm-max-width570pxMax width of the small container in px
$container-md-max-width870pxMax width of the medium container in px

Example:

<div class="container">
	...
</div>
<div class="container container_xs">
	...
</div>
<div class="container container_sm">
	...
</div>
<div class="container container_md">
	...
</div>

Grid

Flexbox grid to build layouts.

Variables
NameDefaultDescription
$gutter20pxSpace between columns in mobile
$gutter-tablet20pxSpace between columns in tablet and above
$columns-number12Columns number for the grid
$grid-background-colorrgba(black, .1)Visual guide of columns grid (only develop)

Building a grid layout is simple: 1. Add class .columns to container 2. Add elements with class .col

Example:

<div class="columns">
	<div class="col"></div>
	<div class="col"></div>
</div>
Modifiers in columns container

.columns_no-gutter Remove the space between columns.

<div class="columns columns_no-gutter">
	...
</div>

.columns_no-gutter-x Remove the space between columns in the x axis.

<div class="columns columns_no-gutter-x">
	...
</div>

.columns_no-gutter-y Remove the space between columns in the y axis.

<div class="columns columns_no-gutter-y">
	...
</div>

.columns_mobile Display the grid for mobile.

<div class="columns columns_mobile">
	...
</div>

.columns_mobile-xl Display the grid for breakpoint $mobile and above.

<div class="columns columns_mobile-xl">
	...
</div>

.columns_multiline Columns items will wrap onto multiple lines.

<div class="columns columns_multiline">
	...
</div>

.columns_centered Center columns items horizontally.

<div class="columns columns_centered">
	...
</div>

.columns_align-items-center Align columns items to the top.

<div class="columns columns_align-items-center">
	...
</div>

.columns_align-items-end Align columns items to the bottom.

<div class="columns columns_align-items-end">
	...
</div>

.columns_show-grid Shows a visual guide of the grid for develop purpose.

<div class="columns columns_show-grid">
	...
</div>
Modifiers in columns element

.col_x Size of the column. X = number of columns (from 1 to $columns-number).

<div class="columns">
	<div class="col col_2">...</div>
	<div class="col col_4">...</div>
</div>

A column can have different sizes at each breakpoint:

<div class="columns">
	<div class="col col_2 col_4-desktop">...</div>
	<div class="col col_4 col_2-desktop">...</div>
</div>

.col_offset-x Size of the column offset. X = number of columns (from 0 to $columns-number - 1).

<div class="columns">
	<div class="col col_2 col_offset-2">...</div>
	<div class="col col_4 col_offset-1">...</div>
</div>

A column can have different offset sizes at each breakpoint:

<div class="columns">
	<div class="col col_2 col_offset-2 col_offset-1-desktop">...</div>
	<div class="col col_4 col_offset-1 col_offset-2-desktop">...</div>
</div>

.col_narrow Column take the space it needs.

<div class="columns">
	<div class="col col_narrow">...</div>
	<div class="col">...</div>
</div>

Buttons

The .btn class can be used on <a> <button>.

Variables
NameDefaultDescription
$btn-height30pxHeight of the button in mobile
$btn-tablet-height40pxHeight of the button in tablet and above
$btn-sm-height30pxSmall height of the button in mobile
$btn-sm-tablet-height$btn-sm-heightSmall height of the button in tablet and above
$btn-lg-height50pxLarge height of the button in mobile
$btn-lg-tablet-height$btn-lg-heightLarge height of the button in tablet and above
$btn-sides-padding12pxSides padding of the button in mobile
$btn-sides-tablet-padding$btn-sides-paddingSides padding of the button in tablet and above
$btn-border-radius0Border radius of the button
$btn-icon-size24pxSize of the svg icon in mobile
$btn-icon-tablet-size$btn-icon-sizeSize of the svg icon in tablet and above
$icon-btn-default-size34pxSize of the icon button in mobile
$icon-btn-default-tablet-size$icon-btn-default-sizeSize of the icon button in tablet and above
$icon-btn-svg-default-size30pxSize of the svg icon button in mobile
$icon-btn-svg-default-tablet-size$icon-btn-svg-default-sizeSize of the svg icon button in tablet and above
$icon-btn-sm-size24pxSmall size of the icon button in mobile
$icon-btn-sm-tablet-size$icon-btn-sm-sizeSmall size of the icon button in tablet and above
$icon-btn-svg-sm-size20pxSmall size of the svg icon button in mobile
$icon-btn-svg-sm-tablet-size$icon-btn-svg-sm-sizeSmall size of the svg icon button in tablet and above
$icon-btn-lg-size44pxLarge size of the icon button in mobile
$icon-btn-lg-tablet-size$icon-btn-lg-sizeLarge size of the icon button in tablet and above
$icon-btn-svg-lg-size40pxLarge size of the svg icon button in mobile
$icon-btn-svg-lg-tablet-size$icon-btn-svg-lg-sizeLarge size of the svg icon button in tablet and above
$icon-btn-border-radius50%Border radius of the icon button

Examples:

General button with text and svg icon:

<button class="btn">Button</button>
<button class="btn">
	<svg class="btn__svg">...</svg>
	Button
</button>

The svg icon can be on the right:

<button class="btn">
	<svg class="btn__svg btn__svg_right">...</svg>
	Button
</button>

General icon button:

<button class="btn btn_icon">
	<svg class="btn__svg">...</svg>
</button>
Modifiers

.btn_disabled Buttons look inactive. Use only in <a>, for <button> add disabled attribute.

<a class="btn btn_disabled">Button</a>
<button class="btn" disabled>Button</button>

.btn_is-full-width Button width 100%.

<button class="btn btn_is-full-width">Button</button>

.btn_shadow Button with box shadow.

<button class="btn btn_shadow">Button</button>

.btn_no-border Button without border.

<button class="btn btn_no-border">Button</button>

.btn_sm Small button.

<button class="btn btn_sm">Button</button>
<button class="btn btn_icon btn_sm">
	<svg class="btn__svg">...</svg>
</button>

.btn_lg Large button.

<button class="btn btn_lg">Button</button>
<button class="btn btn_icon btn_lg">
	<svg class="btn__svg">...</svg>
</button>

.btn_outline Remove the background color.

<button class="btn btn_outline">Button</button>
<button class="btn btn_icon btn_outline">
	<svg class="btn__svg">...</svg>
</button>

Color style

Alabaster bring 4 styles for buttons: error info success and warning

Variables
NameDefaultDescription
$btn-error-background-color#c00Background color error
$btn-error-background-color-hoverdarken($btn-error-background-color, 10%)Background color error hover
$btn-error-color$whiteText color error
$btn-error-color-hover$whiteText color error hover
$btn-info-background-color#666Background color info
$btn-info-background-color-hoverdarken($btn-info-background-color, 10%)Background color info hover
$btn-info-color$whiteText color info
$btn-info-color-hover$whiteText color info hover
$btn-success-background-color#009c00Background color success
$btn-success-background-color-hoverdarken($btn-success-background-color, 10%)Background color success hover
$btn-success-color$whiteText color success
$btn-success-color-hover$whiteText color success hover
$btn-warning-background-color#ca9500Background color warning
$btn-warning-background-color-hoverdarken($btn-warning-background-color, 10%)Background color warning hover
$btn-warning-color$whiteText color warning
$btn-warning-color-hover$whiteText color warning hover
<button class="btn btn_error">Button error</button>
<button class="btn btn_info">Button info</button>
<button class="btn btn_success">Button success</button>
<button class="btn btn_warning">Button warning</button>

Forms

Simple form controls.

Variables
NameDefaultDescription
$inputs-height40pxHeight of input in mobile
$inputs-tablet-height$inputs-heightHeight of input in tablet and above
$inputs-sides-padding12pxSides padding of input in mobile
$inputs-sides-tablet-padding$inputs-sides-paddingSides padding of input in tablet and above
$textarea-height120pxTextarea height in mobile
$textarea-tablet-height$textarea-heightTextarea height in tablet and above
$textarea-padding12pxPadding of textarea in mobile
$textarea-tablet-padding$textarea-paddingPadding of textarea in tablet and above
$inputs-background-colorwhiteBackground color of input
$inputs-readonly-background-colorwhiteBackground color of input with attribute readonly
$inputs-color-text#2b2b2bColor text of input
$inputs-border-color#ebebebBorder color of input
$input-border-hover-color#393939Border color of input in hover
$input-background-hover-colorwhiteBackground color of input in hover
$input-border-focus-color#2b2b2bBorder color of input in focus
$input-background-focus-colorwhiteBackground color of input in focus
$select-arrow-color#2b2b2bArrow color of .select class
$inputs-border-radius0Border radius of input
$field-help-text-color$inputs-color-textText color of .field__help-text class
$field-error-color-text#f00Text color of .error and .errorlist class

Examples:

General form control:

<div class="field">
	<label class="field__label">Label</label>
	<input name="input">
	<div class="field__help-text"></div>
</div>

Form control inline button:

<div class="field">
	<div class="field__inline-submit">
		<input name="input">
		<button class="field__btn">Submit</button>
	</div>
</div>

Form control in two columns:

<div class="field">
	<div class="field__columns">
		<div class="field__column">
			<label class="field__label">Label</label>
			<input name="input">
		</div>
		<div class="field__column">
			<label class="field__label">Label</label>
			<input name="input">
		</div>
	</div>
</div>
Modifiers

.field__column_sm Change width in one column.

<div class="field">
	<div class="field__columns">
		<div class="field__column field__column_sm">
			<label class="field__label">Label</label>
			<input name="input">
		</div>
		<div class="field__column">
			<label class="field__label">Label</label>
			<input name="input">
		</div>
	</div>
</div>

Select

For <select> tag is necessary add a container with class .select

<div class="field">
	<label class="field__label">Label</label>
	<div class="select">
		<select name="select">...</select>
	</div>
	<div class="field__help-text"></div>
</div>
Modifiers

.select_disabled Select disabled style.

 <div class="select select_disabled">
	 <select name="select" disabled>...</select>
 </div>

.select_readonly Select readonly style.

 <div class="select select_readonly">
	 <select name="select" readonly>...</select>
 </div>

.select_is-multiple Select multiple style.

 <div class="select select_is-multiple">
	 <select name="select" multiple>...</select>
 </div>

Checkbox and Radio button

For create a checkbox or radio input import the file check-radio.sass in the file that compile your Sass and be sure you call it after the alabaster.sass file and before the Sass's files you use to build your web.

@import 'route-to-file/alabaster/alabaster'
@import 'route-to-file/alabaster/components/check-radio'
@import 'header'

Example:

<label class="check-field">
	<input class="check-field__input" type="checkbox">
	<span class="check-field__icon"></span>
	<span class="check-field__label">Text label</span>
</label>
<label class="radio-field">
	<input class="radio-field__input" type="radio">
	<span class="radio-field__icon"></span>
	<span class="radio-field__label">Text label</span>
</label>
Modifiers

.check-field_icon-right .radio-field_icon-right Changes the icon to the right.

<label class="check-field check-field_icon-right">
	<input class="check-field__input" type="checkbox">
	<span class="check-field__icon"></span>
	<span class="check-field__label">Text label</span>
</label>
<label class="radio-field radio-field_icon-right">
	<input class="radio-field__input" type="radio">
	<span class="radio-field__icon"></span>
	<span class="radio-field__label">Text label</span>
</label>

.check-field_box .radio-field_box Mixed style between general input and checkbox or radio button input.

<label class="check-field check-field_box">
	<input class="check-field__input" type="checkbox">
	<span class="check-field__icon"></span>
	<span class="check-field__label">Text label</span>
</label>
<label class="radio-field radio-field_box">
	<input class="radio-field__input" type="radio">
	<span class="radio-field__icon"></span>
	<span class="radio-field__label">Text label</span>
</label>

.check-field_disabled .radio-field_disabled Input disabled style.

<label class="check-field check-field_disabled">
	<input class="check-field__input" type="checkbox" disabled>
	<span class="check-field__icon"></span>
	<span class="check-field__label">Text label</span>
</label>
<label class="radio-field radio-field_disabled">
	<input class="radio-field__input" type="radio" disabled>
	<span class="radio-field__icon"></span>
	<span class="radio-field__label">Text label</span>
</label>

.check-field_readonly .radio-field_readonly Input readonly style.

<label class="check-field check-field_readonly">
	<input class="check-field__input" type="checkbox" readonly>
	<span class="check-field__icon"></span>
	<span class="check-field__label">Text label</span>
</label>
<label class="radio-field radio-field_readonly">
	<input class="radio-field__input" type="radio" readonly>
	<span class="radio-field__icon"></span>
	<span class="radio-field__label">Text label</span>
</label>

Number spinner

For create a number spinner input import the file number-spinner.sass in the file that compile your Sass and be sure you call it after the alabaster.sass file and before the Sass's files you use to build your web.

@import 'route-to-file/alabaster/alabaster'
@import 'route-to-file/alabaster/components/number-spinner'
@import 'header'
Variables
NameDefaultDescription
$number-spinner-height40pxHeight of the number spinner
$number-spinner-width94pxWidth of the number spinner

Import number-spinner.js in your js code.

<script src="route-to-file/alabaster/js/number-spinner.js"></script>

Initialize numberSpinner plugin.

JS parameters
NameDefaultDescription
btnMinusSelector.js-number-spinner-btn-minusSelector button minus
btnPlusSelector.js-number-spinner-btn-plusSelector button plus
changeEndedfunctionEvent will be fired after number change
onMaxValuefunctionEvent will be fired when number go to max limit
onMinValuefunctionEvent will be fired when number go to min limit

Example:

<div class="js-number-spinner number-spinner">
	<button class="js-number-spinner-btn-minus number-spinner__btn" type="button">
		<svg class="number-spinner__svg">minus icon</svg>
	</button>
	<input class="number-spinner__input" type="number" value="10" min="0" max="20" step="5">
	<button class="js-number-spinner-btn-plus number-spinner__btn" type="button">
		<svg class="number-spinner__svg">plus icon</svg>
	</button>
</div>
$('.js-number-spinner').numberSpinner();
// or
$('.js-number-spinner').numberSpinner({
	changeEnded: function() {
		// Change event
	},
	onMaxValue: function() {
		// Max value event
	},
	onMinValue: function() {
		// Min value event
	}
});

Toggle

For create a toggle input import the file toggle.sass in the file that compile your Sass and be sure you call it after the alabaster.sass file and before the Sass's files you use to build your web.

@import 'route-to-file/alabaster/alabaster'
@import 'route-to-file/alabaster/components/toggle'
@import 'header'
Variables
NameDefaultDescription
$toggle-width80pxWidth of the toggle
$toggle-padding5pxPadding of the toggle
$toggle-border1pxBorder width of the toggle
$toggle-circle-size30pxSize of the status circle

Example:

<label class="field-toggle">
	<input class="field-toggle__input" type="checkbox">
	<span class="field-toggle__container">
		<span class="field-toggle__circle"></span>
	</span>
</label>
Modifiers

.field-toggle__container_text Adds text YES and NO to the toggle.

<label class="field-toggle">
	<input class="field-toggle__input" type="checkbox">
	<span class="field-toggle__container field-toggle__container_text">
		<span class="field-toggle__circle"></span>
	</span>
</label>

Input file

For create a input file import the file file.sass in the file that compile your Sass and be sure you call it after the alabaster.sass file and before the Sass's files you use to build your web.

@import 'route-to-file/alabaster/alabaster'
@import 'route-to-file/alabaster/components/file'
@import 'header'

Import file-field.js in your js code.

<script src="route-to-file/alabaster/js/file-field.js"></script>

Create a new js FileField object.

JS parameters
NameDefaultDescription
inputSelector.js-input-fileSelector to input file
labelSelector.js-file-textSelector for element with dinamic text
textLabelSeleccionar archivoInitial text for input

Example:

<label class="file-field">
	<input type="file" class="js-input-file file-field__input">
	<span class="js-file-text file-field__label">Seleccionar archivo</span>
	<span class="file-field__icon">icon</span>
</label>
new FileField();
// or
new FileField({
	inputSelector: '.js-new-input-file-selector';
	labelSelector: '.js-new-file-text-selector';
	textLabel: 'New text input';
});
Modifiers

.file-field_disabled Input disabled style.

<label class="file-field file-field_disabled">
	<input type="file" class="js-input-file file-field__input" disabled>
	<span class="js-file-text file-field__label">Seleccionar archivo</span>
	<span class="file-field__icon">icon</span>
</label>

.file-field_readonly Input readonly style.

<label class="file-field file-field_readonly">
	<input type="file" class="js-input-file file-field__input" disabled>
	<span class="js-file-text file-field__label">Seleccionar archivo</span>
	<span class="file-field__icon">icon</span>
</label>

Icons

The .icon class is a container for a svg icon.

Variables
NameDefaultDescription
$icon-default-size50pxSize of icon in mobile
$icon-default-tablet-size$icon-default-sizeSize of icon in tablet and above
$icon-svg-default-size35pxSize of svg icon in mobile
$icon-svg-default-tablet-size$icon-svg-default-sizeSize of svg icon in tablet and above
$icon-sm-size40pxSmall size of icon in mobile
$icon-sm-tablet-size$icon-sm-sizeSmall size of icon in tablet and above
$icon-svg-sm-size25pxSmall size of svg icon in mobile
$icon-svg-sm-tablet-size$icon-svg-sm-sizeSmall size of svg icon in tablet and above
$icon-lg-size90pxLarge size of icon in mobile
$icon-lg-tablet-size$icon-lg-sizeLarge size of icon in tablet and above
$icon-svg-lg-size50pxLarge size of svg icon in mobile
$icon-svg-lg-tablet-size$icon-svg-lg-sizeLarge size of svg icon in tablet and above
$icon-border-radius50%Border radius of icon

Example:

<span class="icon">
	<svg class="icon__svg"></svg>
</span>
Modifiers

.icon_sm Small icon.

<span class="icon icon_sm">
	<svg class="icon__svg"></svg>
</span>

.icon_lg Large icon.

<span class="icon icon_lg">
	<svg class="icon__svg"></svg>
</span>

.icon_outline Remove the background color.

<span class="icon icon_outline">
	<svg class="icon__svg"></svg>
</span>

Color style

Alabaster bring 4 styles for icons: error info success and warning

Variables
NameDefaultDescription
$icon-error-background-color#c00Background color error
$icon-error-color$whiteIcon color error
$icon-info-background-color#666Background color info
$icon-info-color$whiteIcon color info
$icon-success-background-color#009c00Background color success
$icon-success-color$whiteIcon color success
$icon-warning-background-color#ca9500Background color warning
$icon-warning-color$whiteIcon color warning
<span class="icon icon_error">...</span>
<span class="icon icon_info">...</span>
<span class="icon icon_success">...</span>
<span class="icon icon_warning">...</span>

Tables

The .table class is used on table tag.

Variables
NameDefaultDescription
$table-background-color$whiteTable background color
$table-color$blackTable text color
$table-cell-border-colorlighten($black, 85%)Table border color
$table-cell-border-stylesolidTable border style
$table-cell-border-width1px 0 0Table border width
$table-cell-padding10px 15pxCells padding
$table-head-background-colortransparentTable head background color
$table-head-color$table-colorTable head text color
$table-head-cell-border-width0 0 2pxTable head border width
$table-foot-background-colortransparentTable foot background color
$table-foot-color$table-colorTable foot text color
$table-foot-cell-border-width2px 0 0Table foot border width
$table-row-striped-even-background-colorlighten($black, 95%)Even row background color
$table-row-striped-odd-background-color$whiteOdd row background color
$table-row-hover-background-colorlighten($black, 90%)Table row background color hover
$table-row-hover-color$blackTable row text color hover

Example:

<table class="table">
	<thead>
		<tr>
			<th>#</th>
			<th>First</th>
			<th>Last</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td>1</td>
			<td>Value 1</td>
			<td>Value 2</td>
		</tr>
		<tr>...</tr>
	</tbody>
	<tfoot>
		<tr>
			<th>#</th>
			<th>First</th>
			<th>Last</th>
		</tr>
	</tfoot>
</table>
Modifiers

.table_bordered Add borders on all sides of table.

<table class="table table_bordered">
	...
</table>

.table_striped Add add zebra-striping to table.

<table class="table table_striped">
	...
</table>

.table_hover Enable hover state in table rows.

<table class="table table_hover">
	...
</table>

Responsive

Create responsive tables wrapping .table with .table-container

<div class="table-container">
	<table class="table">
		...
	</table>
</div>

Alert modal

Create an alert modal with handlebars js and featherlight

For create an alert modal import the files modal.sass and alert.sass in the file that compile your Sass and be sure you call it after the alabaster.sass file and before the Sass's files you use to build your web.

@import 'route-to-file/alabaster/alabaster'
@import 'route-to-file/alabaster/components/modal'
@import 'route-to-file/alabaster/components/alert'
@import 'header'
Variables
NameDefaultDescription
$modal-background-colorrgba($black, .7)Modal overlay background color
$modal-content-background-color$whiteModal background color
$modal-content-max-widthnoneMax width modal content
$alert-background-color$whiteAlert content background color
$alert-max-width600pxMax width alert content

Import handlebars.js featherlight.js and alert.js in your js code.

<script src="route-to-file/handlebars.min.js"></script>
<script src="route-to-file/featherlight.min.js"></script>
<script src="route-to-file/alabaster/js/alert.js"></script>

Initialize showAlert plugin.

JS parameters
NameDefaultDescription
typeinfoAlert type (error - info - success - warning)
titlenoneAlert title
textnoneAlert text
doneBtnAceptarButton text done
cancelBtnCancelarButton text cancel
loadedCallbackundefinedEvent will be fired after modal loaded
cancelCallbackundefinedEvent will be fired when cancel button is clicked
doneCallbackundefinedEvent will be fired when done button is clicked

Example:

<script id="alert-modal" type="text/x-handlebars-template">
	<div class="alert">
		<button class="js-alert-btn-close btn btn_icon modal__btn-close" type="button">
			<svg class="btn__svg">...</svg>
		</button>
		<div class="alert__content">
			<div class="alert__header">
				<span class="icon icon_{{type}} alert__icon"><svg class="icon__svg">...</svg></span>
				<h3 class="alert__title">{{title}}</h3>
			</div>
			<p class="alert__text">{{{text}}}</p>
		</div>
		<div class="alert__action">
			{{#if cancelBtn}}
			<button class="js-alert-btn-cancel btn alert__btn">{{cancelBtn}}</button>
			{{/if}}
			<button class="js-alert-btn-done btn btn_{{type}} alert__btn">{{doneBtn}}</button>
		</div>
	</div>
</script>
$('#alert-modal').showAlert({
	type: 'error',
	title: 'Alert title',
	text: 'Alert text',
	cancelBtn: false,
	doneCallback: function () {
		// Done event
	}
});

Helpers

Alabaster include somes helpers to make easy sass.

Position

Provides a method for setting an element's positioning properties: position, top, right, bottom and left. Use a null value to skip an edge of the box.

Example:

.element
	@include position(absolute, 10px null null 1rem)

Size

Sets the width and height of the element.

Example:

.element
	@include size(100px, 2em)

Clearfix

Provides a way to include a clearfix for containing floats.

Example:

.element
	@include clearfix

Font smooth

Provides a way to controls the application of anti-aliasing when fonts are rendered.

Example:

.element
	@include font-smooth

Prefixer

Generates vendor prefixes.

Arguments
NameTypeDescription
$propertystringProperty to prefix
$valuestringValue to use
$prefixeslistVendor prefixes to output

Example:

.element
	@include prefix(appearance, none, webkit moz)

Column width

Provides a way to get the size of a column in percentage.

Example:

.element
	@include column-width(2)

Column offset

Provides a way to get the offset of a column in percentage.

Example:

.element
	@include column-offset(2)

Classes

Alabaster include some classes to help easily the construction of html.

Fit image

The .fit-image class add the property object fit = cover to <img> tag.

Example:

<figure>
	<img class="fit-image" src="image.jpg" alt="image">
</figure>

Off screen

The .off-screen class hides elements in the screen.

Example:

<section>
	<h1 class="off-screen">Section title</h1>
	<div>...</div>
</section>

Text align

The .text-center, .text-right and .text-left classes changes the text align.

Example:

<div>
	<p class="text-center">Some text aligned to the center</p>
	<p class="text-right">Some text aligned to the right</p>
	<p class="text-left">Some text aligned to the left</p>
</div>

Flex

Alabaster offers some classes to create grid flex easily.

The .flex class define a container with flex display.

Example:

<div class="flex">
	...
</div>

The .column-flex class change the direction from row to column.

Example:

<div class="flex column-flex">
	...
</div>

The .no-wrap-flex class change the wrap property from wrap to nowrap.

Example:

<div class="flex no-wrap-flex">
	...
</div>

The .justify-content-space-between class apply justify content = space between.

Example:

<div class="flex justify-content-space-between">
	...
</div>

The .justify-content-space-around class apply justify content = space around.

Example:

<div class="flex justify-content-space-around">
	...
</div>

The .justify-content-flex-start class apply justify content = flex start.

Example:

<div class="flex justify-content-flex-start">
	...
</div>

The .justify-content-center class apply justify content = center.

Example:

<div class="flex justify-content-center">
	...
</div>

The .justify-content-flex-end class apply justify content = flex end.

Example:

<div class="flex justify-content-flex-end">
	...
</div>

The .align-items-flex-start class apply align items = flex start.

Example:

<div class="flex align-items-flex-start">
	...
</div>

The .align-items-center class apply align items = center.

Example:

<div class="flex align-items-center">
	...
</div>

The .align-items-flex-end class apply align items = flex end.

Example:

<div class="flex align-items-flex-end">
	...
</div>

JS Plugins

Alabaster include some js plugins to help easily the interaction of html.

No scroll

This function allow lock the scroll of the page, import the file no-scroll.js in your js code.

<script src="route-to-file/alabaster/js/no-scroll.js"></script>
JS parameters
NameTypeDescription
fixedBooleanToggle overflow of the page

Example:

// Lock scroll page
noScroll(true);
// Unlock scroll page
noScroll(false);

Mobile menu

For implement menu mobile functionality import the files no-scroll.js and mobile-menu.js in your js code.

<script src="route-to-file/alabaster/js/no-scroll.js"></script>
<script src="route-to-file/alabaster/js/menu-mobile.js"></script>

Create a new js MobileMenu object.

JS parameters
NameDescription
mobileNavSelector for mobile menu
openBtnSelector for button that open menu
closeBtnSelector for button that close menu
activeClassCss class for mobile menu active
onOpenEvent will be fired after menu open
onCloseEvent will be fired after menu close

Example:

new MobileMenu({
	mobileNav: '.js-mobile-menu',
	openBtn: '.js-mobile-menu-btn-open',
	closeBtn: '.js-mobile-menu-btn-close',
	activeClass: 'mobile-menu_active',
	onOpen: function () {
		// open event
	},
	onClose: function () {
		// close event
	}
});

Outdated browser

This js code verify the browser version and show an alert in case this are outdated or this are not supported.

Variables
NameDefaultDescription
$outdated-browser-background-color$whiteAlert background color
$outdated-browser-text-color$blackAlert text color
$outdated-browser-btn-background-color$blackButton background color
$outdated-browser-btn-background-color-hoverlighten($black, 40%)Button background color hover
$outdated-browser-btn-text-color$whiteButton text color
$outdated-browser-btn-text-color-hover$whiteButton text color hover

For implement functionality import the file outdated-browser.js in your js code.

<script src="route-to-file/alabaster/js/outdated-browser.js"></script>

Brought to you by the lovely folks at Axiacore

1.1.14

2 years ago

1.1.13

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

1.3.6

2 years ago

1.3.5

2 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.3.4

3 years ago

1.3.3

3 years ago

1.3.2

3 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.0

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.1.12

4 years ago

1.1.11

4 years ago

1.1.10

4 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.26

5 years ago

1.0.25

5 years ago

1.0.24

5 years ago

1.0.23

5 years ago

1.0.22

5 years ago

1.0.21

5 years ago

1.0.20

5 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago