- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Bitmasks and CSS? That's a frist!
Admin
public function frist( $wtf ) { echo $wtf; }
Admin
Although different, the CSS in our 10 years old site is quite similar. We have tons of classes like "verdana10black" and "arial12boldgreen", and they're used on each element required. No inheritance to be seen.
Admin
background-color: #$CSS_color; color: #$CSS_background_color;
was it reversed in the orginal story?
Admin
Noticed the typo "There there's the code...."
But perhaps we do need to console George: "there, there".
Admin
Admin
WAT
Admin
"Over there, there exists the code ..." Perfectly cromulent.
Admin
I admit, I had to run this to understand the logic
Admin
Actually I had hard time to think what did php do. Only after time I realized that it generates 256 CSS classes using bitmask, something like rwx permission on unix systems....
Admin
Admin
Admin
....and do the website designer realized that CSS classes are additive? They simply need to define 8 CSS classes and just use as many classes as they like...
Admin
I think this wins.
Admin
Why not have a CSS file that any "adobe certified designer" can change?
Admin
for those who want to see this technique taken to it's still unrealized conclusion
While we're talking style, that should be the possessive "its", with no apostrophe.
Admin
Wait ... This thing prints out every possible combination of the 8 identifiers, resulting in 255 CSS clauses?
I appellatio to your common sense.
Admin
I saw this:
and thought... "TURN DOWN FOR WHAT?!!"Admin
Admin
Okay, but... ftcsrunbi?
Ahhhhhhhhhhh...
frame (top & bottom border), top-aligned, centered, small caps, red?, narrow, bold, italic.
I'm assuming the r stands for red. I can't think what else it would mean, unless it's descriptive of the items they're highlighting that way (reminders).
Admin
Admin
Um, yeah, ... cascading, dude.
While this particular piece of code is pretty WTF, it does illustrate the need for CSS preprocessors. All hail LESS and SASS!
CAPCHA: abbas - abbas dabba doo!
Admin
I see they're using the MORE css transpiler!
Admin
Admin
Am I missing something here? The main loop in that function is using nothing but static values, it's going to spit out the same 8 lines of crap for anything that is passed in.
Holy misuse of bitmap values and loops, wtf.
Admin
Admin
Admin
I think they could use a couple more components, it's a good thing they thought about scalability while writing this.
Admin
This is pure engineering. a complicated solution to a problem that never existed.
example: http://ideone.com/m6BCkb
Admin
Something's still missing. Instead of 8 lines of crap I see this spitting out 128 lines of crap where $i & 1 is TRUE, 64 for $i & 2, etc. As read, "for ($i = 1, $i < 256, ++$i)" is not dependent on the value of $what. So $what did I miss?
Admin
"style" ' You keep using that word. I don't think it means what you think it means.'
("its" vs. "it's" is basic grammar, not style.)
Admin
Edit: Well, it's not the same 255 lines, as each line starts with the parameter. But it always will output 255 lines.
Admin
It's a shame that t and f are defined in the wrong order to make a $what.tf style.
It's also apparent from the srnbi in the name of this function that they probably originally only had those 5 attributes and added c, t, and f later.
Best of luck to whoever develops documents against this style sheet to (a) remember the right order for all these letters if they ever have to use a complicated style, if they are typing in names by hand or (b) find the style they want from the enormous list, if they are using some sort of GUI editor. Of course, if they had just defined 8 individual styles, they could have applied all the styles they wanted in any order and solved both problems, as long as (c) they weren't using some crappy GUI editor that didn't allow them to apply more than one style to an element, which is probably the actual cause for doing this horrible thing.
Admin
I suspect it's for reversed; that is, background becomes foreground and foreground becomes background.
Admin
Code is human now?
Admin
Admin
Admin
Note that multiple classes were not that okay in IE5.5 and partially also in IE6, so maybe this was the reason they did this type of workaround.
Admin
Admin
If you objectify a person, isn't that a widening conversion?
Admin
Nope.
Personification: the act of attaching human-like characteristics or behavior to an inanimate object.
Admin
More accurately: anthropomorphize
Admin
Admin
That..., that thing is ludicrous!
Admin
Thread just keeps on delivering!
odio. -Sure makes me feel. Yeah.
Admin
Admin
Admin
OK, so we have
"t" - Top "c" - Center "s" - Small Caps "r" - "Reverse" colors "n" - Narrow "b" - Bold "i" - Italics
But what's "f" for ? Frame?