From 9f6bc1ae303fb3b9bf758dc7ccdc89271af4c301 Mon Sep 17 00:00:00 2001 From: Adrian Cochrane Date: Thu, 4 May 2023 13:18:24 +1200 Subject: [PATCH] Adjust Readme to have clearer & more up-to-date instructions. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cc6519e..409f05e 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ The first major number indicates any other change to the API, and might break yo ## API To parse a CSS stylesheet call `Data.CSS.Syntax.StyleSheet.parse` which returns a variant of the passed in `StyleSheet`. `StyleSheet` is a typeclass specifying methods for parsing at-rules (`parseAtRule`), storing parsed style rules (`addRule`), and optionally setting the stylesheet's priority (`setPriority`). -If these ultimately call down into a `Data.CSS.Syntax.Style.QueryableStyleSheet` you can call `queryRules` to find all matching style rules organized by psuedoelement. Once you have these style rules (typically by specifying a psuedoelement) you can call `cascade'` to resolve them into any instance of `PropertyParser`. To query rules not targetting a psuedoelement, you can either lookup the "" psuedoelement or use the `cascade` shorthand. +If these ultimately call down into a `Data.CSS.Syntax.Style.QueryableStyleSheet` you can call `cascade` to resolve them into any instance of `PropertyParser`. Or you can use `queryRules`/`cascade'` to handle the pseudoelements yourself before applying the cascade. `PropertyParser` allows to declaratively (via Haskell pattern matching) specify how to parse CSS properties, and how they're impacted by CSS inheritance. It has four methods: `longhand` and `shorthand` specify how to parse CSS properties, whilst `temp` and `inherit` specifies what the default values should be. -- 2.30.2