views:

447

answers:

10

I'm working on a little html/css framework that I can use for most of my websites, at least to have a basis to build on. Here's what I've been using so far:

CSS framework

  • Reset.css - I use the one by Eric Meyer, www.meyerweb.com.
  • Typography.css - All main typography styles for the site (from blueprintcss.org)
  • Forms.css - basic form styles (from blueprintcss.org)
  • Wireframe.css - Here I set up the wireframe for one, two and three columns plus a header and footer. I used the Holy Grail technique, and implemented it so that by setting a class of 'onecolumn', 'twocolumns' or 'threecolumns' to the container div I can switch between the three.

Basic techniques

Some techniques I have some pre-fab examples of for me to re-use in any website:

  • Suckerfish dropdown menus - Horizontal and vertical in various versions
  • Sliding Doors tabs - although I try to use CSS3 where possible

Scripting

  • jQuery - I try to use it as little as possible (that is, if there's css solutions at hand, like the Suckerfish dropdown menu vs. jQ menus)

Plugins

None, yet. I looked into css3pie yesterday and it looked real promising.

Yet to look into

What I haven't used so far but might be interesting is css and js minifiers. Also, currently I include the 5 css files mentioned above in the main.css with @import, maybe I should have them merge automatically before I upload?

Also there's CSS grid systems of course. I never got the hang of those, but maybe I should give it another try. I know the 960 grid is very popular, but I'm not sure if I want to use classes purely for markup (grid_4, column_5, etc.) To me it's a bit like <span class="red"> to make a text red, that's just as bad as using inline style.

Anyway, this is just a basic setup and there's plenty of problems in websites that are not yet incorporated in this framework. So, what should I really check out to improve my framework? (HTML5 and CSS3 welcome, no flash please :P)

Suggestions

I'll make a list here of suggestions made below that I'll check out.

+9  A: 

The best thing you can do is use it. That's the only way you're ever really going to build a framework that does everything you're going to need. Afterall, you don't know everything it'll need until you actually need it.

Where I'm working we have our own PHP Framework and it's been a contsantly changing entity where bits get added when they are required because they weren't originally needed in the spec.

As long as you have something that works for your first project you're underway. Just try it out, add to it when you need something, and optimise where and when you can!

Alex
+1  A: 

I agree with Alex here you should start with using it, this will make sure it has everything you want,

and let me know when it is ready for us to use ;)

regexhacks
+2  A: 

I can't believe I forgot (and nobody has mentioned) fontsquirrel. I've used it to embed a few fonts now and it really works like a charm.

Litso
+3  A: 

If you are looking into minifiers, you're probably willing to run your code through some sort of build script before testing and deploying. If that's the case, I'd suggest looking into LESS for your css: http://lesscss.org/docs

LESS is pure awesomeness.

I don't know how much client-side scripting your projects require, but if it's anything extensive you might want to look into using something like M4 or the C++ preprocessor to add support for includes, ifdefs, etc... this can help keep your code organized and allows you to maintain debug code that doesn't appear in the production build. This post sort of takes that idea to an extreme, but it might give you some ideas.

Out of curiosity, what server-side language are you using?

no
Thanks, especially LESS will be interesting to me. I use php, usually I work with wordpress for basic websites but it really depends on the project.
Litso
Reason for downvote?
no
WordPress is an engine built on PHP.
Visionary Software Solutions
What's your point?
no
+1  A: 

The Blueprint CSS grid technique is better than the 960gs in my opinion. The thing I dislike about 960 is that the the gutters between columns are formed by two "half gutters" on the left and right of each column. It's bizarre; you wind up with half-gutters on the left and right of your layout.

Casey
+1  A: 

There's also the CSS browser selector jQuery plugin. This uses a few simple selectors in your CSS to tell which browser to do what:

.ie .myClass
{
   background-color: #f00;
}

.ff .myClass
{
   background-color: #00f;
}

I use it on my website and it's a much better solution than having CSS hacks or Conditional Comments.

Kyle Sevenoaks
Conditional comments work with or without JS, I wonder how your solution could be "much better" than them.
Felipe Alsacreations
Because conditional comments can only be used for to differentiate IE from other browsers, seeing as they are an IE only thing. This JS allows you to target any browser you want (except from a few obscure ones) without any need for dirty hacks or IE only code :)
Kyle Sevenoaks
+2  A: 

From a performance perspective, I'd use Compass and SASS with the built in BlueprintCSS framework, it mainly takes care of all reset needs to render the same cross browser, you get to use mixins instead of inline classes for your grid. And most of all you end up with one tiny css file that loads real quick. I also use modernizr, html5boilerplate, css browser selector only with serverside php, faster rendering. If your torn between SASS and LESS, the blueprint integration with Compass+SASS is spectacular. Hope this helps!

sway
Hmm, I'm not sure if using SASS is going to improbe my css skills or not. I can see the upside of it, but also some downsides. Anyone have experience with this?
Litso
What downsides do you see?
sway
+2  A: 

why create one more when there are so many out there already. I would rather suggest you to contribute to the frameworks you are referring if you feel something is wrong or missing. That way you will also help everybody who are already using it.

Ashit Vora
Because this way I actually learn something from it. I could blindly take the html5boilerplate template, but that'd be no fun.
Litso
+6  A: 

I highly recommend the HTML5 Boilerplate

HTML5 Boilerplate is the professional badass's base HTML/CSS/JS template for a fast, robust and future-proof site.

After more than two years in iterative development, you get the best of the best practices baked in: cross-browser normalization, performance optimizations, even optional features like cross-domain ajax and flash. A starter apache .htaccess config file hooks you the eff up with caching rules and preps your site to serve HTML5 video, use @font-face, and get your gzip zipple on.

Boilerplate is not a framework, nor does it prescribe any philosophy of development, it's just got some tricks to get your project off the ground quickly and right-footed.

Damien
I'm really starting to dig this, thanks.
Litso
+1 - absolutely the easiest way to go.
Will
although it would be interesting to hear more ideas, I've the feeling this question is kind of dead. I started a new project yesterday and used the boilerplate for it.. I didn't need to add anything at all. This is better than any framework I'd have written myself. I'll just accept it as an answer :)
Litso
+2  A: 

Drop Suckerfish.

With the growing number of touch-only devices (mobile phones, tablets), using hover-based UI elements will just piss off the users.

TuomasR
Not necessarily. You could always add boilerplate Javascript to the framework that would detect the browser and render markup accordingly. http://www.quirksmode.org/js/detect.html
Visionary Software Solutions
I think tuomasR has a point though. I've heard more people say this recently.
Litso