Skip to content

Linter fails with font-display and unicode-range #118

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

Open
yt-topicus opened this issue May 1, 2025 · 4 comments
Open

Linter fails with font-display and unicode-range #118

yt-topicus opened this issue May 1, 2025 · 4 comments
Assignees
Labels

Comments

@yt-topicus
Copy link
Contributor

Describe the bug

The following CSS fails

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/poppins/v23/pxiEyp8kv8JHgFVrJJbecmNE.woff2) format('woff2');
  unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF, U+11B00-11B09;
}
===========================================================

  ____  _              ____ ____ ____    _     _       _
 |  _ \| |__  _ __    / ___/ ___/ ___|  | |   (_)_ __ | |_
 | |_) | '_ \| '_ \  | |   \___ \___ \  | |   | | '_ \| __|
 |  __/| | | | |_) | | |___ ___) |__) | | |___| | | | | |_
 |_|   |_| |_| .__/   \____|____/____/  |_____|_|_| |_|\__|
             |_|

===========================================================

# Lint CSS string...
 => CSS string is not valid:

    - Unknown CSS property "font-display" (line: 1, char: 78)
    - Unknown CSS property "unicode-range" (line: 1, char: 193)
    - Unterminated "property content" (line: 1, char: 295)

To Reproduce

vendor/bin/php-css-lint "@font-face{font-family:Poppins;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/poppins/v23/pxiEyp8kv8JHgFVrJJbecmNE.woff2) format('woff2');unicode-range:U+0900-097F,U+1CD0-1CF9,U+200C-200D,U+20A8,U+20B9,U+20F0,U+25CC,U+A830-A839,U+A8E0-A8FF,U+11B00-11B09}"

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: WSL2
  • Version: v4.1.2

Additional context

@neilime
Copy link
Owner

neilime commented May 13, 2025

@yt-topicus I should works with new release: https://github.com/neilime/php-css-lint/releases/tag/v5.0.0

@neilime neilime self-assigned this May 13, 2025
@neilime neilime added the bug label May 13, 2025
@yt-topicus
Copy link
Contributor Author

@neilime I will check it out and test it. Thank you for your effort for making it PHP 8.4 compatible as well 👍

@yt-topicus
Copy link
Contributor Author

@neilime I've bumped to ^5.0 (5.0.0) and still see the same error as before.

vendor/bin/php-css-lint "@font-face{font-family:Poppins;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/poppins/v23/pxiEyp8kv8JHgFVrJJbecmNE.woff2) format('woff2');unicode-range:U+0900-097F,U+1CD0-1CF9,U+200C-200D,U+20A8,U+20B9,U+20F0,U+25CC,U+A830-A839,U+A8E0-A8FF,U+11B00-11B09}"
===========================================================

  ____  _              ____ ____ ____    _     _       _
 |  _ \| |__  _ __    / ___/ ___/ ___|  | |   (_)_ __ | |_
 | |_) | '_ \| '_ \  | |   \___ \___ \  | |   | | '_ \| __|
 |  __/| | | | |_) | | |___ ___) |__) | | |___| | | | | |_
 |_|   |_| |_| .__/   \____|____/____/  |_____|_|_| |_|\__|
             |_|

===========================================================

# Lint CSS string...
 => CSS string is not valid:

    - Unknown CSS property "font-display" (line: 1, char: 78)
    - Unknown CSS property "src" (line: 1, char: 87)
    - Unknown CSS property "unicode-range" (line: 1, char: 193)

@neilime
Copy link
Owner

neilime commented May 15, 2025

I see, those are not css property but "@font-face" properties.

We must implement this, scrap accepted properties for at-rules, adapt the property linter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants