By default, a simple, generic interface is rendered to get your search instance up and running quickly. However, this library was designed to be customizable and allow developers to use both custom markup and custom CSS.
For developers who only wish to tweak the default UI rather than create something from scratch, there are some variables and utility methods defined in the default CSS that are available for use.
To disable the default styles, please see Installation.
Variables
Although all components in this library utilize the Shadow DOM, CSS variables are able to cross this boundary in a way that normal CSS rules are not. The following variables can be customized in the host DOM to easily customize some of the default styles:
Variable | Default Value |
---|---|
--hawksearch-color-accent |
|
--hawksearch-color-secondary |
|
--hawksearch-color-secondary-light |
|
--hawksearch-color-secondary-dark |
|
--hawksearch-color-background |
|
--hawksearch-container-background |
|
--hawksearch-container-background--alternate |
|
--hawksearch-container-border |
|
--hawksearch-default-line-height |
|
--hawksearch-default-font-color |
|
--hawksearch-default-font-color--inverse |
|
--hawksearch-default-font-family |
|
--hawksearch-default-font-size |
|
--hawksearch-button-background |
|
--hawksearch-button-border-radius |
|
--hawksearch-button-font-color |
|
--hawksearch-form-element-background |
|
--hawksearch-form-element-border |
|
--hawksearch-form-element-border--focus |
|
--hawksearch-form-element-border-radius |
|
--hawksearch-form-element-placeholder-color |
|
--hawksearch-margin |
|
--hawksearch-margin-sm |
|
--hawksearch-padding |
|
--hawksearch-padding-xs |
|
--hawksearch-padding-sm |
|
--hawksearch-secondary-font-color |
|
Internally, all parameters used omit the hawksearch-
prefix. This prefix is used only to override the default values.
Breakpoints
This library uses responsive design with the following breakpoints defined:
Name | Suffix | Minimum Width |
---|---|---|
| ||
small |
|
|
medium |
|
|
large |
|
|
extra-large |
|
|
Grid System
This library uses a 12-column, responsive grid system. To use this system, all columns must have a column
class and be the direct children of an element with a row
class. The number of columns each column elements spans can be controlled with column-XX
classes.
For example, the following will render two equal columns that are stacked until the browser window reaches the Medium
breakpoint:
<div class="row"> <div class="column column--12 column-md-6">Column 1</div> <div class="column column--12 column-md-6">Column 2</div> </div>
Row Modifiers
The following CSS classes can be added to modify the grid display:
CSS Class | Description |
---|---|
| This will cause all columns to be rendered in the reverse order that they are defined |
| This will reduce the space between columns to use |
Column Modifiers
The following CSS classes can be added to modify the column display:
CSS Class | Description |
---|---|
| This will force the column to pull to be aligned to the end of the row |
All CSS classes used for the Grid System support the suffixes defined in Breakpoints.
Utility Classes
There are several basic utility classes available to quickly customize the display of elements.
All utility classes support the suffixes defined in Breakpoints. For example, display-block
and display-sm-none
are both valid.
Display
CSS Class | Description |
---|---|
| This will display an element |
| This will hide an element |
Flex Vertical
CSS Class | Description |
---|---|
| This will vertically center the children of an element |
Flex Gap
CSS Class | Description |
---|---|
| This will add equal |
| This modifier class eliminates the spacing between each child element |
| This modifier class reduces the spacing between each element to |
| This modifier class reduces the spacing between each element to |
Margin
CSS Class | Description |
---|---|
| This adds bottom margin of |
| This removes bottom margin |
| This adds bottom margin of |
Width
CSS Class | Description |
---|---|
| This allows an elements content to determine its width |
| This forces an element’s width to match its parent element |
Text Align
CSS Class | Description |
---|---|
| This aligns descendant content to the left |
| This aligns descendant content to the center |
| This aligns descendant content to the right |