f0r4y312 / jquery-stylesheet Goto Github PK
View Code? Open in Web Editor NEWjQuery plugin for the stylesheet manipulation
jQuery plugin for the stylesheet manipulation
'/{.*}/g' regex fails to work as expected on android 2.3.3 browser returning incorrect selector text which when used by insertRule crashes
I have an iframe that loads content from the same domain. Using the built jquery css, I can do this
$("iframe").contents().find(".site-header").css("height", "100px");
How would I do this with this plugin?
I tried multiple ways, such as:
$.stylesheet( 'iframe .site-header' ).css( "height", "100px" );
Unfortunately they don't seem to work.
So I've found an issue and wondering if you can point me in the right direction.
Say for example you do something like this:
var rules = $.stylesheet('.selector', {margin-top, padding-top, padding-bottom});
And do a dump of rules, if the selector did not have values set for any of the passed in css attributes, then those fields will be blank. Eg:
console.log(rules);
then you'll see
margin-top:'undefined', padding-top:'undefined', padding-bottom:'undefined',
It's not a huge deal, but it means if you're concerned about clean code, then you have to iterate through the object and do a type check/remove undefined fields. So what I'm wondering, is where I'd need to look in the script to fix this issue. The desired result would be to not have the fields returned in the object if they have no value. Eg the above example would result in:
{}
Firefox v21 stops it with a security error when there are linked cross domains CSS stylesheets.
Credits to Emanuele Venturi/Jolly Roger for reporting the bug with a fix.
When the selector passed to insertRule() has stylesheet filters like #page {.section}
, insertRule(selector, css, index) creates a rule #page {}
instead of .section {}
IE 7 does not recognize CSSStyleRule objects, so the instanceOf
check in matchSelector() fails
We at VersionEye are working hard to keep up the quality of the bower's registry.
We just finished our initial analysis of the quality of the Bower.io registry:
7530 - registered packages, 224 of them doesnt exists anymore;
We analysed 7306 existing packages and 1070 of them don't have bower.json on the master branch ( that's where a Bower client pulls a data ).
Sadly, your library f0r4y312/jquery-stylesheet
is one of them.
Can you spare 15 minutes to help us to make Bower better?
Just add a new file bower.json
and change attributes.
{
"name": "f0r4y312/jquery-stylesheet",
"version": "1.0.0",
"main": "path/to/main.css",
"description": "please add it",
"license": "Eclipse",
"ignore": [
".jshintrc",
"**/*.txt"
],
"dependencies": {
"<dependency_name>": "<semantic_version>",
"<dependency_name>": "<Local_folder>",
"<dependency_name>": "<package>"
},
"devDependencies": {
"<test-framework-name>": "<version>"
}
}
Read more about bower.json on the official spefication and nodejs semver library has great examples of proper versioning.
NB! Please validate your bower.json with jsonlint before commiting your updates.
Thank you!
Timo,
twitter: @versioneye
email: [email protected]
VersionEye - no more legacy software!
For example, body {} is stored as style with selector text BODY. Since selector text is treated as case sensitive, rules with element tags are never selected in IE7 and IE8 unless they are also selected using uppercase characters.
Running into a few problems while implementing this (mainly in Chrome, works great in FF) and I'm curious if the developer is still working on this at all.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.