Sourcerer provides the current Joomla document as $document or $doc. Use its Web Asset Manager to add CSS and JavaScript.
CSS
{source}<?php
$assets = $document->getWebAssetManager();
$assets->addInlineStyle('body { background-color: red; }');
$assets->registerAndUseStyle('site.custom', 'media/site/css/custom.css');
?>{/source}
Quick file syntax PRO
{source css="path/to/your/file.css"}{/source}
The css, style, or stylesheet attribute accepts a comma-separated list of files.
JavaScript
{source}<?php
$assets = $document->getWebAssetManager();
$assets->addInlineScript("alert('This is JavaScript');");
$assets->registerAndUseScript('site.custom', 'media/site/js/custom.js');
?>{/source}
Quick file syntax PRO
{source js="path/to/your/file.js"}{/source}
The js, script, or javascript attribute accepts a comma-separated list of files. Add async="true" or defer="true" when the JavaScript file should use the corresponding loading attribute.