CSS module for per-page styling
nav_first.pngFirst: thread:131
HTML Block
Edited: 11 Oct 2012 12:06 by: James Kanjo
Comments: 0
Tags:
nav_prev.pngPrevious: thread:108
Using the Design category
Edited: 23 Dec 2009 16:09 by: pieterh
Comments: 14
Tags:
Last: thread:112
Image Module
Edited: 12 Nov 2009 12:22 by: pieterh
Comments: 0
Tags:
nav_last.png
Next: thread:191
Whiteboard Area
Edited: 09 Dec 2009 11:30 by: pieterh
Comments: 0
Tags:
nav_next.png

Steven HeynderickxSteven Heynderickx wrote on 10 Nov 2009 15:28

Originally suggested by pieterhpieterh as the "CSS module for per-page styling" on 7 September 2009.

It can be very useful to add CSS to a particular page, but this is currently not possible without some admin-level work and affecting all pages in a category. The main use case for per-page CSS is to allow people to customize 'their' pages on shared sites such as HaveMyCV.com, profiles.wikidot.com or any other social site that offers page-based user spaces.

This is a sketch for a new CSS module that lets the page author inject custom CSS into the page:

[[module CSS]]
Some CSS code
[[/module]]

The module can be used anywhere in the page but will put all CSS into the <head> of the page.

Suggested attributes

  • show="true", to render the CSS in a [[code type="css"]] block
  • disable="true", renders the CSS inactive but remains on the page

Multiple modules

If multiple CSS modules are used on the same page, they will all (except disabled modules) be injected into the <head> of the page, in the order that the CSS modules appear on the page.

Symbolic replacement

This section removed for now.


Start a new sub-thread

We discourage direct comments on this thread: to discuss it, please start a sub-thread.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License