Skip to content

Conversation

@Jsbarkleygriggs
Copy link

This pull request adds support for relative paths when using '@import' in style.css.

Problem

When using '@import' in style.css, relative paths fail because 'load_from_string()' does not provide GTK with file context, and thus relative paths become un-resolve-able.

Solution

Changed css_provider.load_from_string() to css_provider.load_from_path(), which provides the necessary path context under the hood.

Texting/Verification

Verified url style imports, absolute paths, and relative paths, didn't break anything, and now I can @import "./colors.css" without issue. Was this necessary? No. Do I hope you merge it? Yes, pretty please.

@Jsbarkleygriggs
Copy link
Author

Fair enough, I have swapped fs::read_to_string() to Path::new().exists(), and re-tested.

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.

2 participants