Comments (5)
Added this feature, please see test:
https://github.com/cssobj/cssobj/blob/master/test/spec/frame.js
And doc:
https://github.com/cssobj/cssobj#--iframe-support
Please let me know whether it's work for you, thanks for this issue!
from cssobj.
This is just awesome and seems to work well, thank you for your top notch support, once I'm done I will make sure to link back to cssobj so more people will know about it.
I also tested multiple selectors, seem to works well as well.:
var obj = { '#widget-1,.widget-1': { backgroundColor: 'blue' } }
In later code when I need to update the style, I do
obj[ '#widget-1,.widget-1'].backgroundColor = 'yellow' which also works.
Only 1 last question: I want to use cssobj to do live website editor, where a user can change certain settings on a control bar and see the changes applied in real time. I used jQuery css() method before but that doesnt work for pseudo elements so I found out about cssobj. Looking at the code I assume that cssobj only applies the changes based on the diff of the obj before and after so it should be safe in term of performance?
from cssobj.
yes it's only apply diff of JS objects, you can check the performance below:
https://futurist.github.io/cssobj-less/
It's live updating the LESS code based on CSSOBJ, which have far more complicated computing with mixins, variables, and functions.
My next plan is to implement the diff instead of getter
and setter
of ES5, that way it won't loop between objects, will gain improved performance ( for very large Object, but small Object using loop still fast! ).
Also, contribution is welcome :)
from cssobj.
I writed a polyfill for window.getMatchedCSSRules()
(Google Chrome private API), just like window.getComputedStyle()
, it also accepts a second argument to return a Style Object of Pseudo.
from cssobj.
Since no furthur feedback for this issue, seems it's working, close it for now.
from cssobj.
Related Issues (15)
- JS 对象字面量写法中的回调函数为何是字符串形式? HOT 2
- Do we handle multiple backgrounds? HOT 9
- Whether allow node.prop accept invalid CSS if it's start with $ HOT 2
- cssobj terminology (glossary, naming) HOT 4
- result.update() does not work with an !important HOT 4
- poll: should drop IE8 support? HOT 4
- Comparison table to be updated HOT 3
- CSSObj seems slow HOT 5
- Class name clash HOT 6
- [poll] remove intros feature
- cssobj 2.0 wishlist HOT 3
- Dead project ? HOT 1
- Duplicate identifier 'lastVal'. HOT 3
- Plugin function not called on update()
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cssobj.