CSS is the abbreviation of Cascading Style Sheets
Questions tagged [css-parsing]
57 questions
2
votes
4 answers
How to get the predominant color of a website?
I'm thinking if it could be possible to get a site's "characteristic" color. For instance, TechCrunch would be green, ReadWriteWeb would be red, CNN also red, Microsoft blueish, PHP purple, etc...
It doesn't have to be accurate, just a best…

Adrian Grigore
- 79
- 1
- 5
2
votes
3 answers
CSS performance - to group or not to group?
I was wondering what impact on parsing and rendering performance may have to group rules in CSS.
Approach 1:
.class1 {
margin: 10px;
padding: 20px;
color: #ccc;
}
.class2 {
margin: 10px;
padding: 30px;
color: #ddd;
}
.class3 {
margin:…

kali187
- 139
- 6
2
votes
1 answer
In what order should you list CSS properties for greatest speed?
Let's take some CSS properties and place them randomly in our CSS file:
outline
pseudo-elements
Color Properties
Background and Border Properties
Box Properties
Flexible Box Layout
Text Properties
Text Decoration Properties
Font…

Chris P
- 63
- 8
2
votes
1 answer
How can I programmatically alter CSS to limit its scope?
I've got a chunk of CSS as a string, and I want to insert it into the DOM such that it only applies to elements in a particular container. Some tools, like Polymer, for example, rewrite CSS selectors so they only apply within a limited scope. How…

Trevor Dixon
- 23,216
- 12
- 72
- 109
2
votes
1 answer
CssParser Error, while converting html to pdf ,PISA & Python
Im trying to convert html documents into pdf file using pisa and python. It works fine for small html code. But when you pass google.com's html data through it , or in fact any big html file , it troughs this error.
here is the code that converts…

thecreator232
- 2,145
- 1
- 36
- 51
1
vote
1 answer
Search cssutils.py parse tree by ID and CLASS selectors
I'm using cssutils in Python to parse CSS style files and would like to search the parse tree by ID and Class. That is, given some CSS style file and some Class name (e.g. div navbar), how do I ascertain the style rules encapsulated by this…

user1004968
- 13
- 4
1
vote
1 answer
Getting a website CSS url from the HTML url
I am building a Python code for scraping colors from a website and linking them to the elements that have that color (for example, I would like to associate all the
with their color). The way I am doing it is that I am trying to access the…

ANDREI MURESIAN
- 11
- 1
1
vote
2 answers
CSSOMParser errors during parsing
I am getting the following errors while parsing css file all.css
null [1:1763] Error in style rule. Invalid token "!". Was expecting one of: , "}", ",", ";", "/", "+", "-", , , , , "inherit", , ,…

Satadru Biswas
- 1,555
- 2
- 13
- 23
1
vote
1 answer
How to append attribute in css with postcss?
I have a following css:
a, a::after, p + .selector, .selector > .my-selector, .selector::before {
}
I want to append [data-123] to all of the selectors. So something like:
a[data-123], a::after[data-123], p[data-123] + .selector[data-123],…

Axel
- 4,365
- 11
- 63
- 122
1
vote
0 answers
r - Merging multiple XML pages calling a data frame of URLs
I am trying to create a big data frame made of multiple xml pages.
I am able to create a data frame for a single…

euclideans
- 75
- 1
- 11
1
vote
1 answer
How to get StyleRules as a string output using ExCSS Parser
I'm using ExCSS to parse and manipulate a stylesheet string. So far so good.
But I can't find any documentation on how to convert the manipulated style rules into a string.
Although the code may not be relevant to this question, this is what I'm…

zed
- 2,298
- 4
- 27
- 44
1
vote
1 answer
Parse CSS into JavaScript with selector awareness
I want to build something that could consume a .css file return a function that would take an array of class names and return the styles that would apply to an element with those class names, as a JavaScript object. (Such an tool would be suitable…

Alan H.
- 16,219
- 17
- 80
- 113
1
vote
1 answer
Stylesheet parsing error for [dir=rtl] when using cssutils python module
I'm parsing a css stylesheet with cssutils python module.
The parser emits an error when reaching the "[dir=ltr] div.row div.label" selector.
I would like to find a way to modify the CSS to make the parser happy and maintain the same…

vejeta
- 133
- 11
1
vote
0 answers
Need to get all Stylesheets from a website by URL - JAVA
Hi guys I need for my project a CSS parser. I just look around and I find always the same libraries. But they don't have the implementation for obtaining the CSS file or code from a website. All of them need local files that I don't have because I…

Guchelkaben
- 1,205
- 1
- 12
- 18
1
vote
1 answer
Parsing nested CSS-styled text in C#
I am expecting to have a text as a string input in C# as shown under BEFORE_PROCESSING title. This text needs to be formatted such that:
The naked sentences without any style tag (e.g. Sentence 1)must get a style tag to make the entire sentence…

F. Aydemir
- 2,665
- 5
- 40
- 60