Can't resolve absolute paths when prefixed with `~` in scss files
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- tooling
Research direction
Reproduce the issue with the shown SCSS @font-face block and inspect postcss-url's URL resolution entry point. The work is done when a ~font-awesome path resolves from node_modules rather than relative to the SCSS file and asset inlining works.
Written by the indexing model from the issue text.
Description
I have a font-face block as follows:
@font-face {
font-family: 'FontAwesome';
src: url('~font-awesome/fonts/fontawesome-webfont.eot?v=4.7.0');
src: url('~font-awesome/fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype');
font-weight: normal;
font-style: normal;
}
postcss-url can't seem to resolve ~font-awesome/fonts/fontawesome-webfont.eot to the correct node_modules path and resolves it relative to the scss file that's being transformed i.e. /Users/me/my-project/src/~font-awesome/fonts/fontawesome-webfont.eot which causes inlining to not work since there's no font file at that path.
Is there a way to have postcss-url resolve ~ prefixed paths from node_modules instead of relative to the scss file?
- Dominant language
- JavaScript
- Stars
- 383
- Forks
- 58
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from postcss/postcss-url
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
postcss/postcss-url#183 · 1 comment · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
postcss/postcss-url#182 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
postcss/postcss-url#181 · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
postcss/postcss-url#180 · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
postcss/postcss-url#179 ·
All issues in postcss/postcss-url
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·