[css-fonts] Support 1 @font-face (1 file) providing both normal and italic font-styles
Open
Nobody has claimed this yet.
css-fonts-4
- Dominant language
- Bikeshed
- Stars
- 4.9k
- Forks
- 816
- PR merge metrics
- PR metrics pending
Description
@nyshadhr9 pointed out today that this doesn't work as expected:
<html>
</head>
<style>
@font-face {
font-family: 'Sample VF';
font-weight: 400;
font-style: normal;
src: url("VfItalSlnt-Regular.ttf") format('truetype');
}
@font-face {
font-family: 'Sample VF';
font-weight: 400;
font-style: italic;
src: url("VfItalSlnt-Regular.ttf") format('truetype');
}
p1 {
font-family: 'Sample VF', display;
font-style: normal;
}
p2 {
font-family: 'Sample VF', display;
font-style: italic;
}
</style>
</head>
<body>
<p1>hello world</p1><br>
<p2>hello world</p2>
</body>
</html>

Perhaps rather than duplicating the @font-face, this should be possible:
@font-face {
font-family: 'Sample VF';
font-weight: 400;
font-style: normal italic;
src: url("VfItalSlnt-Regular.ttf") format('truetype');
}
Contributor guide
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.
Research direction
Start by reviewing the reported @font-face example and the proposed font-style: normal italic syntax. Determine the intended behavior when one font file supplies both styles, and define completion as supporting the example without duplicating the @font-face rule.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100