Skip to content

Commit 9ffdc7c

Browse files
committed
Updated readme
1 parent 72037b6 commit 9ffdc7c

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# 0.10.0
22

3-
Planned for Monday, December 24 2018.
3+
Released on Friday, January 4 2019.
44

55
- Initial release

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,23 @@
1111

1212
AngleSharp.Css extends the core AngleSharp library with some more powerful CSS capabilities. This repository is the home of the source for the AngleSharp.Css NuGet package.
1313

14+
## Basic Configuration
15+
16+
If you just want a configuration *that works* (as close as possible to real browsers) you should use the following code:
17+
18+
```cs
19+
var config = Configuration.Default
20+
.WithCss(); // from AngleSharp.Css
21+
```
22+
23+
This will register a parser for CSS related content. The CSS parsing options and more could be set with parameters of the `WithCss` method. Alternatively, all the (desired) parts may be registered individually as well. That mostly boils down to three elementary parts:
24+
25+
- A CSS parser (implementing the `ICssParser` interface, e.g., `CssParser`)
26+
- A factory for creating CSS declarations (`IDeclarationFactory`)
27+
- The styling service that can handle CSS documents, see `CssStylingService`
28+
29+
For an interactive DOM (i.e., to handle `style` attribute changes in the HTML document) an observer needs to be registered as well.
30+
1431
## Advantages of AngleSharp.Css
1532

1633
The core library already contains the CSS selector parser and the most basic classes and interfaces for dealing with the CSSOM. AngleSharp.Css brings the following advantages and use cases to life:
@@ -25,6 +42,18 @@ The core library already contains the CSS selector parser and the most basic cla
2542

2643
The main idea behind AngleSharp.Css is to expose the CSSOM as it would be in the browser (and potentially beyond, i.e., useful for being used by editors). Originally, most of the code found here was embedded in the AngleSharp.Core library, however, due to the overhead for HTML use cases it was decided to transfer the code into its own repository.
2744

45+
## Features
46+
47+
- Feature validators (e.g., for `@supports`)
48+
- Document functions (e.g., for `domain`)
49+
- Pseudo elements (e.g., `::before`)
50+
- Declarations (e.g., `display`) incl. knowledge of their values
51+
- Dynamic DOM coupling (i.e., to react to `style` attribute changes)
52+
- CSS custom properties (also known as CSS variables) with extensibility
53+
- Media queries and all other commonly implemented rules
54+
- Calculated values (i.e., `calc(20px + 50%)`)
55+
- Window-based declaration calculations, see `window.GetComputedStyle`
56+
2857
## Participating
2958

3059
Participation in the project is highly welcome. For this project the same rules as for the AngleSharp core project may be applied.

0 commit comments

Comments
 (0)