Redefining the style

General discussion of development ideas and the approaches taken in the 3.x branch of phpBB. The current feature release of phpBB 3 is 3.3/Proteus.
Forum rules
Please do not post support questions regarding installing, updating, or upgrading phpBB 3.3.x. If you need support for phpBB 3.3.x please visit the 3.3.x Support Forum on phpbb.com.

If you have questions regarding writing extensions please post in Extension Writers Discussion to receive proper guidance from our staff and community.
Post Reply
Greenweaver
Registered User
Posts: 4
Joined: Wed Nov 15, 2006 2:39 am
Location: In the rain
Contact:

Redefining the style

Post by Greenweaver »

Just a quick post for now so I can get my thoughts out loud until I consider the best way to possibly implement the idea. But the just of it would be to have a full set of css rules that are "phpBB" prefixed, pretty much like we would do with database table prefixes.

As the open source projects are becoming more integrated with one another, one of the key issues that causes a lot of issue between integration is the clash of css selectors, rules and general markup. My idea would be to prefix all of phpBB's markup selectors and rules allowing easier integration with things such as primarily users websites and/or other like minded projects such as ourselves. If this idea became consistent across multiple applications then we could provide easier integration methods.

A quick example would be to take commonly used tags such as:

Code: Select all

<p>
<div id="header">
<div class="panel">
And convert them to be of a phpBB identity:

Code: Select all

<p class="phpbb4">
<div id="phpbb4_header">
<div class="phpbb4_panel">
The idea would be that we never clash at all with any other css.
Linkage: Find me at Styles Development & Discussion | Get a new style | Customise your style | phpBB3 userguide
Noteage:
Graphics requests to members over 20 posts and genuine phpbb requirements | I do not provide custom psd files
ToonArmy
Registered User
Posts: 335
Joined: Fri Mar 26, 2004 7:31 pm
Location: Bristol, UK
Contact:

Re: Redefining the style

Post by ToonArmy »

My site uses a patched style.php to edit all the CSS rules to prefix div#phpbb in front of them, achieving a similar result.
Chris SmithBlogXMOOhlohArea51WikiNo support via PM/IM
Image
topdown
Registered User
Posts: 12
Joined: Sat Dec 01, 2007 5:04 am

Re: Redefining the style

Post by topdown »

I think a patch to the style.php would be best for the simple fact is that if all of the selectors were prefixed, it would be a mess for style authors to update.

Now on the other hand, my thought was a new Base style with the use of compatible HTML5 and CSS3 in preparation for future markup standards.
If that was the case then using prefixed selectors would be optimum because it's all fresh anyway. ;)
User avatar
ameeck
Registered User
Posts: 86
Joined: Sun Nov 13, 2005 6:43 pm
Location: Prague, Czech Republic
Contact:

Re: Redefining the style

Post by ameeck »

topdown: phpBB4 will probably use a completely different style and current styles will not be compatible either way.

Chris' solution is quite elegant but has a drawback if you want to integrate some markup into phpBB itself, as the inserted application/script/widget will also be a descendant of div#phpbb. It will also happen in Greenweaver's solution, but less.
Please think before you post.
ToonArmy
Registered User
Posts: 335
Joined: Fri Mar 26, 2004 7:31 pm
Location: Bristol, UK
Contact:

Re: Redefining the style

Post by ToonArmy »

ameeck wrote:Chris' solution is quite elegant [...]
I beg to differ: http://phpbb.cs278.org/patches/css-namespace.diff ;)
Chris SmithBlogXMOOhlohArea51WikiNo support via PM/IM
Image
User avatar
Highway of Life
Registered User
Posts: 1399
Joined: Tue Feb 08, 2005 10:18 pm
Location: I'd love to change the World, but they won't give me the Source Code
Contact:

Re: Redefining the style

Post by Highway of Life »

ToonArmy wrote:I beg to differ: http://phpbb.cs278.org/patches/css-namespace.diff ;)
LOL! :lol:

I think he meant the end result or outcome. :D
Image
LiquidSpark
Registered User
Posts: 9
Joined: Sun Jan 31, 2010 6:55 pm

Re: Redefining the style

Post by LiquidSpark »

topdown wrote:Now on the other hand, my thought was a new Base style with the use of compatible HTML5 and CSS3 in preparation for future markup standards.
If that was the case then using prefixed selectors would be optimum because it's all fresh anyway. ;)
I second the use of W3C validation using HTML 5 and CSS 3. I plan to release a template mod for ProSilver that updates it all to HTML 5, CSS 3 and uses CSS (and PHP if necessary) in place of all the JavaScript. JavaScript just slows things down, although you might argue that putting more effort on the server will still slow things down for everyone. But many of these JavaScript codes can be simplified with creative CSS coding.

(mods, you can delete my new topic on this)
Post Reply