The word color is used loosely here to describe the surface-level aspects of a design, including colors, backgrounds, borders, shadows and other properties that are decorative and highly likely to change over time. Basscss includes a suite of color utilities as a starting point. Use these as a guide for creating your own styles.
<h3 class="center">
<span class="dark-gray">.dark-gray</span>
<span class="mid-gray">.mid-gray</span>
<span class="light-gray">.light-gray</span>
<span class="lighter-gray">.lighter-gray</span>
<span class="white">.white</span>
<span class="blue">.blue</span>
<span class="red">.red</span>
<span class="yellow">.yellow</span>
<span class="green">.green</span>
</h3>
<div class="center p1 white bg-dark-gray">.bg-dark-gray</div>
<div class="center p1 bg-mid-gray">.bg-mid-gray</div>
<div class="center p1 bg-light-gray">.bg-light-gray</div>
<div class="center p1 bg-lighter-gray">.bg-lighter-gray</div>
<div class="center p1 bg-white">.bg-white</div>
<div class="center p1 bg-blue">.bg-blue</div>
<div class="center p1 bg-red">.bg-red</div>
<div class="center p1 bg-yellow">.bg-yellow</div>
<div class="center p1 bg-green">.bg-green</div>
<div class="center p1 bg-darken-1">.bg-darken-1</div>
<div class="center p1 bg-darken-2">.bg-darken-2</div>
<div class="center p1 bg-darken-3">.bg-darken-3</div>
<div class="center p1 bg-darken-4">.bg-darken-4</div>
<div class="p1 m1 border bg-white">.border</div>
<div class="p1 m1 border-top bg-white">.border-top</div>
<div class="p1 m1 border-right bg-white">.border-right</div>
<div class="p1 m1 border-bottom bg-white">.border-bottom</div>
<div class="p1 m1 border-left bg-white">.border-left</div>
Apply the .input
color style to input, select, and textarea elements to control appearance.
<form class="sm-col-6">
<label>Email Address</label>
<input type="text" class="block full-width input">
<label>Password</label>
<input type="password" class="block full-width input">
<label>Select</label>
<select class="block full-width input">
<option>Option 1</option>
<option>Option 2</option>
<option>Option 3</option>
<option>Option 4</option>
<option>Option 5</option>
</select>
<label class="block full-width mb2">
<input type="checkbox" checked>
Remember me
</label>
<button class="button-blue">Sign In</button>
</form>
Use the .table-light
style as a starting point,
then apply color utilities to style tables.
Artist | Album | Release Date |
---|---|---|
Huey Lewis and the News | Sports | 1983 |
Phil Collins | No Jacket Required | 1985 |
Peter Gabriel | So | 1986 |
<table class="table-light">
<thead>
<tr>
<th>Artist</th> <th>Album</th> <th>Release Date</th>
</tr>
</thead>
<tbody>
<tr> <td>Huey Lewis and the News</td> <td>Sports</td> <td>1983</td> </tr>
<tr> <td>Phil Collins</td> <td>No Jacket Required</td> <td>1985</td> </tr>
<tr> <td>Peter Gabriel</td> <td>So</td> <td>1986</td> </tr>
</tbody>
</table>
Artist | Album | Release Date |
---|---|---|
Huey Lewis and the News | Sports | 1983 |
Phil Collins | No Jacket Required | 1985 |
Peter Gabriel | So | 1986 |
<table class="table-light bg-white border rounded">
<thead class="bg-light-gray">
<tr>
<th>Artist</th> <th>Album</th> <th>Release Date</th>
</tr>
</thead>
<tbody>
<tr> <td>Huey Lewis and the News</td> <td>Sports</td> <td>1983</td> </tr>
<tr> <td>Phil Collins</td> <td>No Jacket Required</td> <td>1985</td> </tr>
<tr> <td>Peter Gabriel</td> <td>So</td> <td>1986</td> </tr>
</tbody>
</table>
Colors styles use the following variables. To alter these defaults, declare new values after importing Basscss with Rework.
:root {
--dark-gray: #304650;
--blue: #0076df;
--mid-gray: #667680;
--light-gray: #f3f9f9;
--red: #f95020;
--green: #00d930;
--yellow: #ffdc00;
--darken-1: rgba(#036,.03125);
--darken-2: rgba(#036,.0625);
--darken-3: rgba(#036,.125);
--border-color: var(--darken-3);
--border-width: 1px;
--border-radius: 3px;
}
These basic color styles are also available as a standalone NPM module.
npm install basscss-color-basic
To learn more about using Basscss and the motivations behind it, read the Design Principles.
Or to learn more about web design in general, check out the Guide to Basics.