Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse .css files #140

Merged
merged 2 commits into from
May 8, 2022
Merged

Parse .css files #140

merged 2 commits into from
May 8, 2022

Conversation

kaj
Copy link
Owner

@kaj kaj commented May 7, 2022

Add in-memory representation of some more css data, and use a separate parser when parsing css.

  • Allow css files in @use directives.
  • Allow css files in @import directives.
  • Allow css files in the meta.load-css mixin.
  • Parse rules in css files
  • Parse @import statements in css files.
  • Parse other @-rules (@media etc) in css files.
  • Parse comments in css files.

@kaj kaj force-pushed the css-objects branch 2 times, most recently from 3abc9ee to b705e0e Compare May 7, 2022 15:17
Make more of it represenatable in structs, rather than just writable
to a buffer.
@kaj kaj force-pushed the css-objects branch 21 times, most recently from 36e56cf to 9b6f3cb Compare May 8, 2022 18:09
Add a parser for loading `.css` files in `@use` and `@import`
statements.
@kaj kaj merged commit dccbf61 into master May 8, 2022
@kaj kaj deleted the css-objects branch May 8, 2022 18:45
kaj added a commit that referenced this pull request May 17, 2022
Released 2022-05-17 (On the Norwegian Constitution day 🇳🇴).
Progress: 4331 of 6523 tests passed in dart-sass compatibility mode.

* Update minimum supported rust version to 1.49.0 (from 1.45.2).
* `SourceFile.parse()` now returns a `Result<Parsed>` rahter than a
  `Result<Vec<sass::Item>>`, and `Format::write_root` now takes a
  `Parsed` (PR #140).
* `FsFileContext::file` is replaced by `FsFileContext::for_path`,
  which initializes a file context and loads a file from it (PR 137).

* Hopefully improved relative file finding on windows (PR #137).
* Plain css `@import` rules is only allowed [on a few
  condtions](https://sass-lang.com/documentation/at-rules/import#plain-css-imports),
  in other cases an error is reported (Issue #139, PR #137).
* Rsass can now parse (some) plain css as well as scss.  Css files can
  be referenced in `@use` and `@import` directives, as well as in the
  `meta.load-css` mixin (PR #140).
* Make the `calc(...)` function signal an error when args are known to
  be invalid css (PR #138).
* Change `map.deep-merge` to match recent change in dart sass.
* Minor fix in whitespace around at-rules.
* Instrumented attempted file loading with `tracing` (PR #137).
* Fix a typo in LICENSE (Issue #136).
* Update sass-spec test suite to 2022-05-10.
* Make rust version of sass-spec more directory-aware (which fixes one
  of 5825 tests).
* Use a crates badge that actually works.

Thanks to @jonassmedegaard for #136, and to @fasterthanlime for
reporting the problem that #137 attempts to fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant