Skip to main contentSkip to search
Clay
  • Get Started
    • How to Use Clay
    • Composition Philosophy
    • How to Read This Documentation
    • Migrating From v2.x
    • Using Clay in JSPs
  • Components
    • Alert
    • Application Bar
    • Aspect Ratio
    • Autocomplete
    • Badge
    • Breadcrumb
    • Button Group
    • Buttons
    • Card
    • Chart
    • Color Picker
    • Data Provider
    • Date Picker
    • DropDown
    • Empty State
    • Form
      • Checkbox
      • Dual List Box
      • Input
      • Radio Group
      • Select
      • Select Box
      • Toggle Switch
    • Forms Hierarchy
    • Heading
    • Icon
    • Label
    • Layout
    • Link
    • List
    • Loading Indicator
    • Localized Input
    • Management Toolbar
    • Modal
    • Multi Select
    • Multi Step Nav
    • Nav
    • Navigation Bar
    • OverlayMask
    • Pagination
    • Pagination Bar
    • Panel
    • Picker
    • Popover
    • Progress Bar
    • Provider
    • Sidebar
    • Slider
    • Sticker
    • Table
    • Tabs
    • Text
    • Timelines
    • Time Picker
    • Toolbar
    • Tooltip
    • TreeView
    • Upper Toolbar
    • VerticalBar
    • Vertical Navigation
  • Contributing
  • CSS Framework
    • Paver
    • SCSS
    • Color
    • Grid
    • Content
      • Typography
      • C Kbd
    • Utilities
      • Accessibility
      • Autofit
      • Border
      • C Focus Inset
      • C Inner
      • Color Utilities
      • C Spacing Utilities
      • Display
      • Flex
      • Float
      • Inline Item
      • Overflow
      • Position
      • Shadow
      • Text
      • Vertical Align
      • Visibility
      • Width and Height
    • Playground
  • Examples
K
  • Docs
  • Sass API
  • Blog
  • Storybook
  • Codesandbox
  • Github
  • Use this menu to toggle between Atlas and Base Themes.

CSS Framework

A Web Implementation of Liferay's Experience Language

  • Overview
  • Base Theme
  • Atlas Theme
  • Liferay Portal
  • Customizing Clay CSS
  • Adding CSS Rulesets to Clay CSS

Overview

Clay CSS is the web implementation of Liferay’s Experience Language. This is a system for building applications in and outside of Liferay, designed to be fluid and extensible, as well as provide a consistent and documented API.

Clay CSS is based on Bootstrap 4.4.1. You will find Bootstrap's and Clay CSS' API to be very similar because Clay CSS was created to fill the gaps between Bootstrap's and Liferay's UI as well as providing familiarity to new devs joining the Liferay ecosystem.

Clay CSS is shipped with two flavors, Base and Atlas Theme. The Base Theme is bundled with frontend-theme-styled in Liferay Portal. Atlas Theme is our flagship theme that is bundled with frontend-theme-classic.

Base Theme

The Base Theme provides a familiar starting point to develop your own custom theme by preserving default Bootstrap styles such as colors and sizing. It contains all CSS rulesets for both themes. You can toggle Base Theme by clicking the cog icon inside the top right nav.

|-- Functions
|-- Base Variables
|-- Mixins
|-- SCSS

Atlas Theme

Atlas Theme is a set of Sass variables that are applied on top of the Base Theme. The variables change everything from colors to sizing and spacing. No additional rulesets are required. This allows us to reuse a CSS ruleset instead of having to duplicate and overwrite it in frontend-theme-classic, saving us from CSS bloat.

|-- Functions
|-- Atlas Variables
|-- Base Variables
|-- Mixins
|-- SCSS

Liferay Portal

Clay CSS is installed during build time in Liferay Portal. There is a placeholder file clay.scss where Clay CSS should be imported. This file is included inside the head tag as an external stylesheet in Portal.

If you are using Liferay Theme Tasks to deploy your theme, you can see the contents of clay.scss in your-theme/build/_css/clay.scss. If you are extending the Styled Theme, clay.scss should contain @import clay/base; and Classic Theme should have @import clay/atlas;. You can view the Clay CSS source in your-theme/build/_css/clay.

You can switch between Base and Atlas Theme at any time by creating a file clay.scss in your-theme/src/css/clay.scss and importing Base or Atlas. This will overwrite the default clay.scss file used by Portal.

Customizing Clay CSS

Liferay Portal provides a placeholder file _clay_variables.scss and imports it at the top of base.scss and atlas.scss. This file should contain all your Clay CSS Sass Variable overwrites. You can change the primary color to red by creating a new file named your-theme/src/css/_clay_variables.scss and adding the line $primary: red;. Clay CSS has thousands of customization options that gives you full control over the styles of each component.

Adding CSS Rulesets to Clay CSS

You can add CSS rulesets to the clay.scss file by creating a file called _clay_custom.scss in the your-theme/src/css directory. _clay_custom.scss is imported at the bottom of base.scss and atlas.scss.

How can this be improved? Create an issue!