{Carrer web log} ←
picoCSS - really small JavaScript Framework
Thursday, April 28, 2011 { 15 Comments }
I've had some extra time during the Easter holidays and I did some JavaScript experiments. The result of that experiment is super small JavaScript library for basic CSS manipulation mainly for building iPhone, iPad and Android web apps.This project has one objective DOM CSS manipulation with JavaScript that is optimized for webkit browsers(Safari, Chrome) and it will work in (Firefox, Opera) without the part of animation.
With this library you can do just three things insert inline CSS or manipulate CSS with changing the id and the class name of the HTML element. Also webkit CSS3 animation are supported. I've used Svetlo like selector engine.
The coding syntax looks like this:
p.select("#a").css("background-color : green; color: #fff;");
or
p.select("#b").animate('0.5', '1','360','1','1','1','1', '0','0');
or
p.select("#main").att("class","bumm");
And here are some examples (Safari/Chrome):
Example 1
Example 2
Example 3
Example 4
>> Download & Watch the library on GitHub
This Framework is not meant to be complete JS Framework like jQuery. It is just CSS helper library.
If you need small but complete framework for mobile development I suggest you check:
Zepto.js
Ender.js
jQuery Mobile
All comments and suggestions are appreciated!
15 Responses to “picoCSS - really small JavaScript Framework”
- // // 4/29/2011
- // Vladimir // 4/29/2011
- // Unknown // 5/04/2015
- // Vladimir // 5/04/2015
- // Vladimir // 5/04/2015
-
// tordenalf
// 3/01/2016
This is a great alternative to jquery, because of similar syntax and the ultra-lightweight of pico. I'm currently rewriting some jquery-code to use pico instead, but I'm having trouble figuring out how to implement an "each" loop with custom function (without adding the function to pico itself). It would be nice if you could provide a demo for doing that.
- // tordenalf // 3/01/2016
- // Vladimir // 3/01/2016
-
// tordenalf
// 3/02/2016
In the methods for working with the elements, you have this code:
this.value = this.each.call(this.value, function (i) {...
As foreach always returns undefined, this.value will be set to undefined.
I suggest you change the line so you do not set this.value:
this.each.call(this.value, function (i) {...
This will allow a select to be used more than once.
It will allow chaining:
p.select('.widget').att('class', 'big').css('background-color:green');
And it will also allow this kind of usage:
p.select('.widget');
p.att('class', 'big');
p.css('background-color:green');
Regards,
Bjørn
-
// tordenalf
// 3/02/2016
I use the jQuery "each" function a lot.
In order to facilitate something similar, I changed my local picoCSS.js this way:
- I removed the existing "each" function
- I replaced all "this.each" with "[].forEach" in the javascript
- I added this each function:
each: function (fn) {
[].forEach.call(this.value, fn);
return this;
},
Now, I can do a custom "each" the following way:
p.select('div').each(function(elm) {
p.value = [elm];
p.css('background-color:green');
});
- // tordenalf // 3/02/2016
- // tordenalf // 3/02/2016
- // Vladimir // 3/02/2016
-
// tordenalf
// 3/03/2016
I went further, and have created a new library "picoQuery". It is based on picoCSS, but has the same syntax as jQuery, facilitating an easier shift away from jQuery. Its here: https://github.com/rosell-dk/picoQuery. Again, thanks for your great little piece of work, and thanks for encouraging using it freely
- // Vladimir // 3/03/2016
<< Home
About Me <<<
Name: Vladimir Carrer
vladocar [at] gmail.com
Location: Verona, Italy
I'm a web designer, developer, teacher, speaker, generally web addicted ...
My projects <<<
- AI Prompt Directory
- Hand Drawn Icons
- Font Design Inspiration
- Font Pairings
- Free SVG Cut File
- Upcoming NFT projects
- Discord Tutorials
- Free Sublimation Designs
- Tech Feed
- MySQL Lite Administrator
- Quark Mini PHP CMS
- Formy - CSS Form Framework
- Emastic - CSS Framework
- Malo - CSS Library
- The Golden Grid
- 1 line CSS Grid Framework
- Two Lines CSS Framework
- Child Selector System - CSS Framework
- Better Web Readability Project
- Azbuka - CSS Typographical Base Rendering Library
- ClipR - bookmarklet for better reading
- CSS3 Action Framework
- CSS Mini Reset
- HTML5 Mini Template
- CSS Mobile Reset
- picoCSS - JavaScript Framework
- HTML Lorem Ipsum Crash Test
- Object Auto Documentation - JavaScript
- o - JS Library for Object Manipulation
- Foxy - CSS Framework
- Tumblr Free Theme - Better Readability Project
- Box - CSS Framework
- SMART CSS GRID
- nanoJS - Minimal JS DOM Library
- Flexy CSS Framework
- Katana is CSS Layout System made with Flexbox
- Micro CSS Reset
- 60 Grid System
- Simple CSS Button
- ramd.js JavaScript library for making web applications.
- Minimal Notes web app build with Vue.js
- Scribble Font for Prototyping & Wireframing
- Flex One - 1 CSS Class System
- Floaty - CSS Float Based Layout System
- Infinity CSS Grid
- CLI Convert websites into readable PDFs
- keywords-extract - CLI tool, extract keywords from any web page.
- screenshoteer - Make website screenshots and mobile emulations from the command line.
- Basic.css - Classless CSS Starter File
§§Previous Posts <<<
- Svetlo - One Line JavaScript Selector Engine
- Child Selector System - CSS Framework
- About Repaint and Reflow in JavaScript
- Better Readability Project - Free Tumblr Theme
- CSS3 Chat Bubbles
- Line length and Font Size relation in design
- Safari - open links in new tabs
- Hacker News Mobile (Front Page Reader )
- CSS Mobile Reset
- About JSONP in JavaScript
Other Profiles <<<
Content is licensed under a Creative Commons Public Domain License