Show HN: Picnic.css, a lightweight Bootstrap alternative (picnicss.com)
I've tried to make it as light as possible. It's only tested with Firefox and Chrome, however I intend to test it in IE down to 9. What would you change? What would you add? Any feedback or pull request is greatly welcome! MIT Licensed
148 comments
[ 3.5 ms ] story [ 245 ms ] threadOr maybe change the outline to an outer glow?
One thing I didn't see was the ability to add offsets to a grid item?
http://glenmaddern.com/articles/introducing-am-css
In other words, the CSS should work for this HTML
instead of the unidiomatic (and broken from the POW of accessibility)I added ``line-height: 1.4em;`` in dev tools and now they look ok - https://www.dropbox.com/s/ksxu15t9rrofxti/Screenshot%202014-...
How is your project different from purecss?
There are some other smaller differences:
- The <select> just looks nice with Picnic in Firefox.
- Picnic relies in class combinations, while Pure relies in long specific class names. Compare <button class = "primary">Test</button> vs <button class = "btn btn-primary">Test</button>
- Pure CSS is surely more solid; it's been created by Yahoo and tested by thousands of webs
995 bytes!
As a branding thing, I'd change that URL. I get that it's short but minfwk.com doesn't really look like "Min Framework" to me. It just looks like a bunch of letters. A domain like mincss.com, getmin.com, minframework.com or something more legible would be better.
Thanks! You have no idea how good that feels.
> As a branding thing, I'd change that URL. I have had minframework.com for a while and still do, but it seems too long (Right now it redirects to minfwk.com) but I just got mincss.com and I prefer it quite a bit. I'll update Github accordingly. Thanks for the suggestion!
Weird border: http://i.imgur.com/mLxx8gy.png
Not centered: http://i.imgur.com/edMfAMC.png
What if you want a button that looks like a like and a link that looks like a button. In your case you will have to overwrite "button" selector, which is with very high specificiy and to override the main selector styles.
and then copy the relevant for only a link styles to your link selector ( a ).This works good for small code base, but once you go to several pages and need specific links it starts to make a lot of problems.
I stopped using this way of styling buttons not so long ago and I switched it to :
And also for links And then I can easily switch without touching my code.Same applies for input[type='...'] rules. I just add class name.
May I ask, in what situation did you encounter this? I still think this is way too specific (I have never had to do something like that). Picnic lets buttons be buttons, and links be links OR buttons, just buttons cannot be links.
I think in this way you can achieve less bloated classes and better readability. I value that higher than allowing buttons to be links. That's just my preference. Thank you for the insight though, it's a clear and good explanation of Picnic limits.
How would this be fixed if you want it completely semantic?
About the nav, you could make it completely semantic by using some JS or not making it responsive, however I thought the benefits of having a responsive <nav> would compensate for those 2 extra lines of code.
i'm not a web dev (i'm a backend guy), i need to make some front end PoCs sometime, so i don't stay up on CSS packages and kits.
One thing -- hovering the demo button seems to affect elements underneath: http://goo.gl/9vD0D2
But again, in a professional setting I would prefer Bootstrap any day. It looks well done, it's easy to customize, and it has a lot of pre-built components.
The only problem with bootstrap is the weight, it's way too heavy for most part of the world's mobile internet.
(will fix ASAP)
But it's a little more extreme.
[edit] nvm, it just doesn't work over HTTPS. http://owenversteeg.com/min-bootstrap-plugin works. I'll have to look at setting up https for that.
Many websites have a whole lot of overlap in terms of UI patterns (a nav bar, responsive grids, etc). Is it really necessary for every dev to hand-code that nav bar, or fight with CSS's terrifyingly bad grid support? Not really, which is why these frameworks are nice.
Would you elaborate what you mean by fighting? Bootstrap is extremely simple to customize and I am no front-end guru.
A specific example: Bootstrap expects dropdowns to be unordered lists with anchors as the top-level element, so having a fixed-position header as the first item while its children scroll is difficult. If this has been our CSS based on our markup, it would've taken fifteen minutes, because we could have gone in and done a bit of basic surgery on our module, making it more flexible. (This may not be the best example, but that's the general idea.)
IMO, if I were to arrive on a new project and saw the front-end devs reinventing the wheel, it would immediately set off a red flag.
That may be your problem. Maybe I'm a glutton for punishment, but I especially enjoy this type of work.
As a back end developer who needs to do bits and pieces of front end stuff, I can see this taking me months (at least) to learn JavaScript CSS, and design to make something as anywhere close to bootstrap. Or I could just use what they have done (and thousands have tested) and save myself a whole lot of effort. And if you have other developers joining the team, at least they will be familiar with whatever framework you are using, rather than some in house crap that someone wrote ages ago, and has now left the company.
I have not looked at the source code for Bootstrap, but if it was crap I assume there would be a ton of articles ranting about like there are for PHP.
So (with Bootstrap at least) I am getting pre-written, tested, understood code, documented code, probably of at least "reasonable" quality, with a community online to help with problems. Does you own code have that? I certainly don't have time to write that stuff myself .
The more experienced I get as a developer, the less code I try to write. People with the "code everything yourself" attitude remind me of when I was fresh out of university, and didn't realise how incompetent I was at the time.
simple enough once you've worked with CSS long enough
The thing is, if you actually designed web UIs professionally and didn't rely on these toolkits, you could immediately make a reasonable first guess at all of those things and you'd be doing it in the context of your specific project. The total time to refine everything over the entire development cycle might be a few minutes, and most of that would be cross-browser testing, which obviously for professional work you should be doing even if you're using a toolkit.
I've nothing against toolkits. They can be useful for quick prototypes. They do a competent basic job for in-house tools written by people who aren't front-end developers and just need something that works. But for high-end UI work? I have never written a major professional project that still used any of these toolkits in the final production code.
Most toolkits aren't sufficiently reliable that you can trust them without testing, so you've still got one of the biggest and most tedious jobs to do whether you use one or not.
Often attention to detail is lacking in significant areas. Using a big name toolkit is no guarantee of quality; many of them have absolute howlers on their own demo pages that are immediately obvious in at least one major browser, often just in the visuals before you even start interacting.
But more than any of that, for real projects, you're often going to have branding requirements that will mean extensive customisation. All those default colour and typography schemes aren't worth much. And some all-things-to-all-people toolkit that works great if you use its defaults might be hiding all kinds of limitations if you're not using a flat design, or if your layout requirements are more demanding than "simple responsive grid", or if you want something that works right on mobile or supports proper keyboard navigation or meets accessibility requirements or...
Toolkits are great for basic work, and for a lot of projects that really is all you need, but you don't design a Rolls Royce by picking wheels and bodywork from a catalogue.
People with the "code everything yourself" attitude remind me of when I was fresh out of university, and didn't realise how incompetent I was at the time.
Code everything myself? Unlikely. Code things myself when quality matters and off-the-shelf isn't good enough? Always.
CSS frameworks like Bootstrap provides you with a tested baseline, so you can be confident that the front-end you created will look the same across a wide range of browsers.
Certainly Bootstrap won't be suitable for all scenarios, but starting from a framework is generally a good idea.
My guess is mobile Chrome is using the hover effect to denote selected - which I guess kinda makes sense. I'd probably just disable that hover style altogether to be honest, Bootstrap doesn't use one and I think that's better.
Looking forward to actually trying this in near future!
The problem with CSS frameworks is that they are invasive when it comes to writing semantic HTML. As someone who is working on developing semantic HTML and improving the skill, its annoying when you use a CSS framework which it encourages you to perform inline styling.
Layout should be separated from content.
Bootstrap and others is are great for making something quick and dirty. Semantic UI[1] is onto something decent but the issue of inline styling irritates me. Its good that Picnic is taking an approach to use better naming conventions for classes. I think this is a preference thing but I find writing button-one better than writing btn-1. I think its readable, can be understood quickly , easy to pick up if you have been away from development for a while, looks maintainable even for novice developers.
Shorthand has never been my thing, it just adds more complexity and nuisance by wasting time digging into someones documentation to understand whats going on. I would rather spend an extra two seconds writing out a full name rather than using shorthand knowing that its going to make my life easier in the future.
Great work, I'll definitely play with this when I get time.
1. http://semantic-ui.com/
I like the intent behind the Semantic UI project, but I feel like CSS preprocessors like LESS and SASS allow for semantic markup through the use of mixin functions out of the box without needing to use anything else.
0. http://semantic-ui.com/elements/button.html 1. http://semantic-ui.com/elements/divider.html
Your death will be the first