Download the PHP package octfx/template-styles-extender without Composer

On this page you can find all versions of the php package octfx/template-styles-extender. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package template-styles-extender

TemplateStylesExtender

Widens the CSS that Extension:TemplateStyles accepts on a wiki.

Writing CSS on a wiki that has this installed? See docs/css-support.md for what you can now write.

Requirements

Installation

Download the zip file from the latest release page.

Extract the folder to extensions/TemplateStylesExtender, then add to LocalSettings.php:

The order matters. Both extensions register a handler for the <templatestyles> tag and the later registration replaces the earlier one, so loading this one first leaves wrapclass with no effect and no error.

Configuration

Scoping and URL policy are unchanged by default: every selector is still scoped to .mw-parser-output, and url() is still checked against $wgTemplateStylesAllowedUrls. Two settings below opt out of one each.

Configuration Description Default
$wgTemplateStylesExtenderCustomPropertiesDeclaration Allow CSS custom properties (--*) to be declared. true
$wgTemplateStylesExtenderExtendCustomPropertiesValues Allow var() in properties whose own grammar has no slot for it. true
$wgTemplateStylesExtenderRequireFontFamilyPrefix Require @font-face family names to start with TemplateStyles. TemplateStyles enforces this itself; installing this extension lifts it until you set this to true. @font-face is not scoped to .mw-parser-output, so a family declared on a TemplateStyles page applies to the whole rendered page, including skin chrome. false
$wgTemplateStylesExtenderAllowExternalResourcesInCustomProperties Allow url(), image-set() and the other external-resource functions inside custom property (--*) values. Those URLs are then no longer checked against $wgTemplateStylesAllowedUrls; enable it only where an enforced Content-Security-Policy restricts these fetches to trusted hosts. false
$wgTemplateStylesExtenderEnableUnscopingSupport Allow CSS to be unscoped by setting a wrapclass attribute. false
$wgTemplateStylesExtenderUnscopingPermission The right a user must hold to unscope CSS. Must name a right that already exists on the wiki; this extension defines none. editinterface

$wgTemplateStylesDisallowedProperties and $wgTemplateStylesDisallowedAtRules still apply, including to the properties this extension adds, so either list can narrow the grammar back per property or per at-rule.

Nothing here narrows it wholesale; removing the extension is that lever. It needs no database change, and neither does turning a setting off: pages already rendered keep their CSS until they are re-parsed, and a stylesheet page that used the widened CSS still renders with the refused rules dropped. It cannot be saved again until they are removed.

Unscoping with wrapclass

With $wgTemplateStylesExtenderEnableUnscopingSupport on, a wrapclass attribute scopes the stylesheet to a class of your choosing instead of .mw-parser-output:

Three things to weigh before enabling it:

Contributing

Issues and pull requests go to the repository.

License

GPL-2.0-or-later. See COPYING.


All versions of template-styles-extender with dependencies

PHP Build Version
Package Version
Requires composer/installers Version >=1.0.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package octfx/template-styles-extender contains the following files

Loading the files please wait ...