Sets restrictions and displays AMP style sheet warnings for AMP apps.
- limits style sheet size to 50Kb
- displays error messages in development, if
!importantis used - removes
!importantmodifiers - displays error messages in development, if
behavioror-moz-bindingbanned declarations are used - removes
behaviorand-moz-bindingbanned 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 to50000removeImportant— whether to remove!importantmodfiers, defaults tofalseremoveReserved— whether to remove rules with reserved selectors, defaults tofalseremoveBanned— whether to remove banned declarations, defaults tofalse
Read more about the Addon Installation.