I allow css user input.
What is an easy and efficient way to test this css on client side?
I am looking for a solution for javascript. I do not want to send css to some remote server or something else.
Context: User Permission css
Thanks.
Edit: NVM on this. I started using the server side validator: https://github.com/chriso/node-validator
function getDefinedCss(s){ if(!document.styleSheets) return ''; if(typeof s== 'string') s= RegExp('\\b'+s+'\\b','i'); // IE capitalizes html selectors var A, S, DS= document.styleSheets, n= DS.length, SA= []; while(n){ S= DS[--n]; A= (S.rules)? S.rules: S.cssRules; for(var i= 0, L= A.length; i<L; i++){ tem= A[i].selectorText? [A[i].selectorText, A[i].style.cssText]: [A[i]+'']; if(s.test(tem[0])) SA[SA.length]= tem; } } return SA.join('\n\n'); } // Then you check the class if exists by calling getDefinedCss('myclassname')
You can use the CSSLint engine in the application . Its source is available at https://github.com/stubbornella/csslint
Source: https://habr.com/ru/post/1393104/More articles:How to get superimposed texture on top of inline image without extra layout with CSS? - cssNeed to serialize a silverlight bitmap - serializationhttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1393101/what-is-the-difference-between-calling-function-with-and-without-when-we-assign-functions-to-variables&usg=ALkJrhg6-dWthYv29TJtiCAnUgPU-geF9Qclip path in RaphaΓ«l.js - javascriptGtk # in monodevelop no longer works after upgrading to ubuntu 11.10 units - ubuntuConnection with libpng in Qt - qtExecuteStoreQuery returns multiple rows, how can I get it in IList or List - c # -3.0Apple Newsstand Download Full Notification - iosCss user permission - securityXcode background application launch detection for debugging Newsstand application - iosAll Articles