Skip to content

Latest commit

 

History

History
43 lines (28 loc) · 1.57 KB

index.md

File metadata and controls

43 lines (28 loc) · 1.57 KB

UiWidgets

A Yii2 Extension that provides ligtweight UI widgets implemented in CSS.

For license information see the LICENSE-file.

Documentation is at docs/README.md.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist BeastBytes/UiWidgets

or add

'BeastBytes/UiWidgets': '~1.0'

to the require section of your composer.json.

Contents

Overview

Each widget has an asset that declares it's CSS. The CSS mainly defines widget behaviour but also includes minimal presentational CSS so that the widgets can be used "out of the box"; presentational CSS is clearly commented.

See the relevant widget documentation for the widget's CSS classes. Widget CSS classes use BEM naming conventions to minimise specifity.

Definining your own presentation styles can be done in a number of ways:

  • Specify an asset bundle to publish that points to your own CSS; this should depend on the widget's asset so that the behaviour is inherited, e.g. for the Tabs widget depend on 'BeastBytes\UiWidgets\TabsAsset'. This is a good option if you are also publishing JavaScript - for example - to update ARIA attributes.
  • Add rules in your CSS.
  • If you are using a bundler that supports CSS, e.g. Webpack, you can import the widget's and your CSS.