Sets restrictions and displays AMP style sheet warnings for AMP apps.
- limits style sheet size to 50Kb
- displays error messages in development, if
!important
is used - removes
!important
modifiers - displays error messages in development, if
behavior
or-moz-binding
banned declarations are used - removes
behavior
and-moz-binding
banned declarations - displays error messages in development, if
.-amp-*
ori-admp-*
selectors are used - removes CSS rules that use
.-amp-*
ori-admp-*
selectors
Install and configure amp
addon:
import {addon as addonAmp} from 'nano-css/addon/amp';
addonAmp(nano);
or
addonAmp(nano, {
limit: 50000,
removeImportant: true,
removeReserved: true,
removeBanned: true,
});
, where
limit
— maximum size of style sheet on server, defaults to50000
removeImportant
— whether to remove!important
modfiers, defaults tofalse
removeReserved
— whether to remove rules with reserved selectors, defaults tofalse
removeBanned
— whether to remove banned declarations, defaults tofalse
Read more about the Addon Installation.