SCSS
=begin rakudoc :type<plugin>
AUTHOR
Richard Hainsworth, aka finanalyst
VERSION
v0.1.0
Overview
Uses the Dart CASS program to convert SCSS input into CSS output that is added to the RPO structure.
The plugin has a SCSS to CSS converter that is intended to be run once and after any other plugin that defines a scss: field
in its %.config attribute in the correct manner for HTML-Extra, eg.,
%!config =
:scss( [ self.add-scss-string, 2], ),
In order to accomplish this, the SCSS workspace has a closure to be called with the RakuDoc-Processor (rdp) object.
A renderer, eg. RakuDoc::To::HTML-Extra, will call the closure after all plugins have been enabled, eg.
$rdp.template.data<SCSS><run-sass>.( $rdp )
After which $rdp.templates.data<css> will contain a string of all the CSS from each of the :scss fields
concatenated in the correct order. Any existing value of :css provided by the renderer itself is assumed to have
order 0.
Warnings
The scss attribute must be a sequence of Str,Int tuples, eg.,
:scss( [ '/*! Test */.bolder { font-weight:450; } ', 1 ] , ),so the comma inside the last ) is important.
This plugin adds CSS to the Processor instance for each plugin. If a plugin has both a
:cssand a:scssattribute set in its config, SCSS will ignore the:cssand render the:scss. If a plugin only has a:cssand no:scss, the:cssvalue will be concatenated with the order set or with an implied order of 0.It is assumed that a shell call to
sass -vwill yield a version number, otherwise the plugin willdie.
Note that a plugin can be disabled by overriding the default plugin list (see Customisability in HTML-Extra ).
=place semantic:AUTHOR :caption<Credits> =place semantic:VERSION :!toc =end rakudoc