This is a place to discuss any thoughts related to the Custom CSS / Campaign Theming that we're working on. In a nutshell, we're exploring the option of allowing people to define their own campaign-wide CSS rules. We've got a working prototype, but we'd like some more feedback before releasing it to everyone.
If you're not part of the beta, don't worry, we'll be releasing it soon enough.
If you are part of the beta (or have ideas), think about these questions:
* Are there any malicious CSS tricks we need to be especially aware of? We do some sanitizing and sanity checks, but CSS hackery is not something I'm terribly familiar with.
* What changes to the markup are necessary to support maximum flexibility in theming? We're happy to add extra divs, spans, classes, ids, etc, etc. If there's a particular CMS out there that does a good job with this, please point us.
* How can we roll this out (new markup, specifically) without destroying existing campaign theming? Do we need to support both the old and new markup styles? That would be a real pain on our end, but I can understand if it's necessary.
* Is there anything else we should be considering at the same time? What am I missing?
Thanks again for all your help!
HTGN's got a good point about having a maximum z-index, but you should also allow negative z-indexes (they're used to create the custom backgrounds that we use).
I honestly can't think of any reason you'd need new markup; I've already utilized a custom CSS style for one of my campaigns (overriding the site's CSS using a Firefox plugin to make some of the default colors a bit darker, fitting in with the rest of the page better). I can't see any reason you'd need anything new for the markup, though - just a place to input the campaign's CSS style rules.
It's great to hear about new OP functionality like this!
-Easy capability to change core OP elements (wiki item/character slug color, main-column background color, etc..) is monumentally kickass!
-Style elements associated via class (ie, .classname) worked fine, however, style elements associated via id (ie, #idname) did not work.
-Sometimes elements being altered by style would appear unchanged in preview mode, but then changed once the page was saved. Other times not. More testing needed.
-Content property (requiring pseudo element :before or :after) does not appear to work.
First impressions: Very cool. The capability to make quick site wide changes is awesome, not to mention "hiding" all the styling in the custom CSS makes the page source easier to read for less net savvy players who would still like to make alterations to pages or additions. Campaigns that are "properly" coded with full CSS implementation in mind (start planning now!) can easily be given an entirely new look from the custom CSS area alone. The concept is a huge leap forward for OP.
That said (and granted this isn't really CSS related per se, but still worth mentioning), I believe people with custom top or side navigation setups (like me) will still desire some sort of "include" feature to get blocks of code onto every page - as CSS isn't really setup to handle this (particuarly with the Content property not working) - but based on what I'm seeing with the custom CSS, such a feature could likely be put into place via a similar format.
More to come as I keep experimenting with it.
The z-index points about branding and positioning false links is something I'll have to think about. Catching and sanitizing that kind of thing would require a CSS parser and then some rules to check. That may be doable, but parser writing is up there with templating in my list of things I don't want to do.
Keep the ideas coming...
"rollover test page":http://www.obsidianportal.com/campaign/dangerous-kalamar-4/wikis/ooc
EDIT: Though the custom CSS would probably allow us to do the custom backgrounds properly, removing the ability to use the z-index property would break a lot of sites all at once until everyone fixes them.
Also, there's some z-index stuff that I require with a DST I recently created; even if z-indexes would be disallowed on other stuff, not allowing them with custom DSTs could be problematic.
On the cosmetic end, it would be good to make the OP logo in the top navigation bar a transparent PNG so that it blends against backgrounds better.
On the more technical end, in addition to users hiding things you just don't want them to as discussed above, there is the danger that they will hide the text area used to edit their own CSS, the button used to submit their changes, or one of their parent elements, rendering it impossible for them to fix their own mistake.
I've got an easy fix for these issues though:
Create a second non-user-controlled CSS entry which is applied _after_ the user's, and contains rules for mission-critical elements. Anything you're comfortable with the user overriding you leave where it is, and anything vital you move into the new entry, along with a few new rules which enforce _display_ and _alpha_ values on things which shouldn't ever be hidden. Because CSS entries are processed in order, anything set there will automatically trump what the user may have specified.
- The drag-handle under text areas ("example":http://www.obsidianportal.com/campaign/chainsawxiv-test-campaign/comments) should probably be converted to transparent PNG.
- Some buttons are button tags, some are spans, picking one would look better and be easier to style.
The z-index discussion is good. We may implement something along the lines of limiting the z-index values, but as discussed someone can just inline style what they want. We really don't do a lot of pre-rendering or manipulating. We basically take the HTML and CSS you give us, do some basic sanitizing, and then send that to the browser. We mainly look at structure and don't consider semantics. Trying to determine z-values of particular elements is much more semantic than anything else we do. It's a tough call, as I don't want to leave open known vulnerabilities, but at the same time I hate the idea of spending lots of time fighting a war that's only in my head. So far we've been blessed with non-malicious users (and very awesome users, in fact) so I hate fighting shadows.
I like the idea of a final, mission critical stylesheet. I was also worried about people making the site unusable for themselves, and this would work well to prevent that.
Transparent png for the logo is a good idea. Not sure why we haven't done that yet.
Button vs link/span on "buttons" has been a pain in our ass for a long time. Anyone have a good guide on making button inputs look decent? Or, is there a way to make submit inputs with links and spans? I really hate the default HTML buttons.
I don't know of a better canned solution for custom buttons off the top of my head, but its a simple enough concept that I'm sure there are some out there. Personally, I quite like the standard interface elements as presented by browsers these days, but I know that this is more because of their uniform presentation and resolution independence than for aesthetic reasons, and I can understand your distaste. If you bullet point what you consider to be the vital features and qualities you need, and the deficiencies you see in the default inputs, I'd be happy to do some digging though.
For CSS styling, I'd like to be able to style elements by ID.
What I'd like to do with this is to restyle the Wiki section of a campaign entirely, moving the 'Create New Page' button all the way up to the top of the OP sidebar right below the User Profile. Then I'd hide the rest of the OP sidebar, and utilize the space freed up to expand the content section of my wiki.
The only way this would work out well and without removing any nice features is if the 'Previous Versions' and 'Tags' section of the wiki pages are moved to the Edit page, which honestly is probably where they should be anyways. The rest of the stuff in the OP sidebar really doesn't need to appear on every Wiki page; instead, I think they'd be just fine appearing solely on the campaign's Home page.
Another thing that might be needed would be an overall class being added to all Wiki pages. That way, I'd be able to style the Wiki pages separately from the non-Wiki pages.
Are you sure that there's an overall 'wrapper' class added to Wiki pages, to allow us to style them differently from the other pages? I haven't seen one when looking through the source code. Ideally, different page types would have different wrapper classes.
You're correct however that the different content types aren't differently classed at the moment. That'd be handy. Most of the individual elements have ID's already however, so you can target them easily enough.
To be completely honest, I almost wet myself when I read about the rollover. That's something I've been wanting to do for ages. Good lord. You guys have made my year.
Something is off here, cause this definitely is not working for me..
EDIT: As a point of clarification, applying style to default OP elements by ID works for me (like the main-column background from my earlier post, etc.) but styling content that I write into the pages by ID is what is not working for me. Have you tested that with success?
EDIT 2: Hmm, apparently using the id tag under div's and such doesn't work when coding content for pages?
_You’re correct however that the different content types aren’t differently classed at the moment._ - What does this mean? I think this may be what I was trying to express when asking if people wanted more semantic markup. If you want us to add more classes and such we can do that, I just need a little guidance on what to add. I suppose I could also just go nuts and add tons of classes to everything.
In any case, based on the fact that everyone seems generally happy with this feature as-is, I'm planning on rolling it out to everyone in the next couple days. We may do a quiet rollout, make sure it's generally working, and then make a big announcement.
Thanks again for all the help and ideas, and if you have more ideas, please keep them coming.
Further, different page types should have different IDs to allow us to specify different styles for different page types. For example, all 'Wiki' pages should have a 'wiki' class that covers everything on the page, all 'character' pages should have a 'character' class, the character list should have a 'characterList' class, etc.
and so forth...
Would that help?
A couple suggestions related to your list of potential classes:
1) Adding a class "edit-page" that is only used as an additional class (i.e., class="wiki-page edit-page") would solve the desire to distinctly style edit and display pages, without having to create a separate edit page class for each page type.
2) The class "adventurelog-post" breaks the implicit naming convention used in the other classes ("foo-page"). Recommend using "adventurelog-page" instead.
Anyways, great that you're putting this out there. Definitely looking forward to it, even though it totally means a rework of my campaign again (eventually, anyways). After that, just work on making 'includes' available and you'll make tons of people happy, happy, happy;)
Just trying to help out.
I hope to launch this to everyone sometime in the next week.