Giter VIP home page Giter VIP logo

Comments (5)

futurist avatar futurist commented on May 29, 2024

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.

yellow1912 avatar yellow1912 commented on May 29, 2024

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.

futurist avatar futurist commented on May 29, 2024

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.

TechQuery avatar TechQuery commented on May 29, 2024

@yellow1912

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.

futurist avatar futurist commented on May 29, 2024

Since no furthur feedback for this issue, seems it's working, close it for now.

from cssobj.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.