davatron5000 / decss3 Goto Github PK
View Code? Open in Web Editor NEWA lil' bookmarklet that will strip out your CSS3 rules and show you how gracefully you're degrading.
Home Page: http://davatron5000.github.com/deCSS3/
A lil' bookmarklet that will strip out your CSS3 rules and show you how gracefully you're degrading.
Home Page: http://davatron5000.github.com/deCSS3/
deCSS3 won't work on Firefox due to the inability to access document.styleSheets[i].cssRules
from a cross browser script. this is a bit of a bummer. Hopefully there's a workaround.
The reason I ultimately gave up on mine was that selectors are way harder to remove than properties and values. Ultimately it would be cool if this could negate selectors...
li:nth-last-child(2) {
font-weight: bold;
}
so I guess it would find that, and either somehow remove it or go through each property and negate it:
li:nth-last-child(2) {
font-weight: normal;
}
Totally not anywhere near as comprehensive, but just to give credit where it's due, this is oldest one I've seen: http://intridea.com/2010/4/12/toggle-css3-bookmarklet?blog=company
Hey ya'll -- I tried to do this a while back as well but mine is way ghetto: https://github.com/chriscoyier/CSS3-StripTease
I'm thinking multiple backgrounds should be pretty easy to test for, just look for a comma in the value for background-image and there is one set background-image: none;
Security error
[Break On This Error] if ( ! stylesheet.cssRules ) {
deCSS3...6324741 (line 105)
I dragged the bookmark to my toolbar in Firefox 9 and clicked it, result was the above error.
the site is behind a firewall if that makes any difference.
Most of the commits on this are markdown edits. And that's just tragic. If anyone wants to help prune/rebase/merge those edit, let me know.
If just injecting CSS isn't too lame, this should get the last four No's you have listed:
animation
* {
-webkit-animation: none !important;
-moz-animation: none !important;
}
background-clip
* {
-webkit-background-clip: border-box !important;
-moz-background-clip: border-box !important;
background-clip: border-box !important;
}
background-origin
* {
-webkit-background-origin: 0 0 !important;
-moz-background-origin: 0 0 !important;
background-origin: 0 0 !important;
}
background-size
* {
-webkit-background-size: auto !important;
-moz-background-size: auto !important;
background-size: auto !important;
}
Looks like we lost media query support. I tried to get it back but failed. This may be a unique function since it's not a replace, just a wipeout, it's just unsetting the rule entirely.
when i try this out on a page with css3 by clicking on the bookmark, it does degrade gracefully, but i expected it to get back to css3 when i click it again,
things which happen,
On the whole, a great job. very useful tool and encourages me to use modernizr even more.
Browser: Chrome 16
OS: Windows 7
Just another thing to remove.
-webkit-border-image: none !important;
-moz-border-image: none !important;
border-image: none !important;
-webkit-gradient(linear,left top,left bottom,from(#F4F4F4),to(#ECECEC));
our current search for /linear-gradient(.*?)/g
isn't cutting it here.
After hearing about deCSS3 on ShopTalk I decided to take a look.
It's working great, however I have run into a little but which I figured I'd report (sorry if this sounds a little bit ramble-y for a GitHub issue, but I don't submit many of these things).
Basically when using the bookmarklet on pages of my site, the background (which consists of multiple gradients) screws up and stretches. This is illustrated perfectly when going to http://www.dev-hq.net/ and activating then de-activating the bookmarklet - the background compresses together (I've tested in Chrome). It's interesting to note that when going on to different pages of my website, for example http://www.dev-hq.net/5, the gradient gets stretched the opposite way.
Sorry I couldn't be more helpful and give some sort of test case in which I've found it screws up or find the root of the issue, but I'm a little pushed for time.
Resetting column-count
may have to be on a detection basis. Setting * { column-count: 1; }
can cause layout shifts when child elements are involved.
In the current version, I have all of the following and neither work so well:
column-count: 1!important
// causes problems with nested stuffcolumn-count: none!important
// doesn't override declared column-countcolumn-span: all!important
// doesn't do anything?Any solutions, let me know.
according to a 3rd party report.
Suggested by Paul Irish, the ability to toggle off/on the bookmarklet would be pimp.
Not sure how feasible this is give the fact we're using deleteRule()
in the CSS, but worth thinking about.
When executing the bookmarklet it fails to execute the JavaScript, since it's served as MIME text/plain. Please use rawgit URL instead.
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.