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

themes: add new felipec theme #3441

Merged
merged 3 commits into from Jan 7, 2022
Merged

themes: add new felipec theme #3441

merged 3 commits into from Jan 7, 2022

Conversation

felipec
Copy link
Contributor

@felipec felipec commented Dec 29, 2021

Autogenerated with vim-felipec.

@joshgoebel
Copy link
Member

Please show results of running check-theme utility.

@felipec
Copy link
Contributor Author

felipec commented Dec 30, 2021

Here are the results.

I noticed the tool checks for template-tag and formula, but one is barely used, and the other doesn't seem to be ever used.

Templates/HTML/XML, etc.
- Theme does not fully support.
- scope template-tag is not highlighted
  (css: .hljs-template-tag)

Markup (Markdown, etc)
- Theme does not fully support.
- scope formula is not highlighted
  (css: .hljs-formula)

nice to haves (optional, but many grammars use)
- Theme does not fully support.
- scope meta keyword is not highlighted
  (css: .hljs-meta .hljs-keyword)
- scope meta string is not highlighted
  (css: .hljs-meta .hljs-string)

high fidelity highlighting (this is optional)
- Theme does not fully support.
- scope title.class is not highlighted
  (css: .hljs-title.class_)
- scope title.class.inherited is not highlighted
  (css: .hljs-title.class_.inherited__)
- scope title.function is not highlighted
  (css: .hljs-title.function_)
- scope char.escape is not highlighted
  (css: .hljs-char.escape_)
- scope variable.language is not highlighted
  (css: .hljs-variable.language_)

Accessibility Report
┌───────┬────────────────────────────────────────┬──────────┬──────────┐
│ ratio │ selector                               │ fg       │ bg       │
│ 12.27 │ .hljs                                  │ #dddde1  │ #1e1e22  │
│ 6.64  │ .hljs::selection,.hljs ::selection     │ #1e1e22  │ #bf8fef  │
│ 4.75  │ .hljs-comment,.hljs-code,.hljs-quote   │ #888896  │ #1e1e22  │
│ 7.12  │ .hljs-number,.hljs-literal,.hljs-dele… │ #ef8f8f  │ #1e1e22  │
│ 9.9   │ .hljs-punctuation,.hljs-meta,.hljs-op… │ #efbf8f  │ #1e1e22  │
│ 13.78 │ .hljs-type                             │ #efef8f  │ #1e1e22  │
│ 12.63 │ .hljs-tag,.hljs-title,.hljs-selector-… │ #bfef8f  │ #1e1e22  │
│ 11.8  │ .hljs-string,.hljs-regexp,.hljs-addit… │ #8fef8f  │ #1e1e22  │
│ 12.08 │ .hljs-class,.hljs-property             │ #8fefbf  │ #1e1e22  │
│ 12.47 │ .hljs-name,.hljs-selector-tag          │ #8fefef  │ #1e1e22  │
│ 8.6   │ .hljs-keyword,.hljs-built_in           │ #8fbfef  │ #1e1e22  │
│ 5.81  │ .hljs-section,.hljs-bullet             │ #8f8fef  │ #1e1e22  │
│ 6.64  │ .hljs-selector-pseudo                  │ #bf8fef  │ #1e1e22  │
│ 7.79  │ .hljs-variable,.hljs-params,.hljs-att… │ #ef8fef  │ #1e1e22  │
│ 7.4   │ .hljs-symbol,.hljs-link                │ #ef8fbf  │ #1e1e22  │
└───────┴────────────────────────────────────────┴──────────┴──────────┘

@felipec
Copy link
Contributor Author

felipec commented Dec 30, 2021

Also, my theme was using background-color which is more proper than background, but the checkTheme tool crashed with that.

@joshgoebel
Copy link
Member

I'm not sure it's more "proper". More exact, perhaps. We'd be open to a PR making the tool smarter. It shouldn't have crashed in any case.

@felipec
Copy link
Contributor Author

felipec commented Dec 31, 2021

@joshgoebel Well, it is more precise: background is a shorthand property for a bunch of other properties, which include background-color, the actual property we care about.

I've sent a pull request to check for that too: #3449.

@felipec
Copy link
Contributor Author

felipec commented Jan 1, 2022

Do I need to add template-tag and formula? Or what is missing for consideration?

@joshgoebel
Copy link
Member

I need to find time to pull it up and at least have a quick glance at it... holidays. You haven't been forgotten. Just busy.

@felipec
Copy link
Contributor Author

felipec commented Jan 5, 2022

All right. Here's a screenshot if it helps: screenshot.

@joshgoebel
Copy link
Member

Approved, please add CHANGELOG entry?

Autogenerated with vim-felipec.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
@felipec
Copy link
Contributor Author

felipec commented Jan 7, 2022

@joshgoebel Done. I followed the steps of intellij-light and updated tools/developer.html too.

BTW. I think my generator might be useful to other theme creators, for example:

palette:
  red: '#ef8f8f'

blocks:
  - - number literal deletion
    - color: red

Gets converted to:

.hljs-number,
.hljs-literal,
.hljs-deletion {
  color: #ef8f8f;
}

The full YAML code I used to generate my theme is this: felipec.yml. I use HSL instead of hex triplets, but they get automatically converted.

CHANGES.md Outdated Show resolved Hide resolved
@joshgoebel joshgoebel merged commit 8a8835b into highlightjs:main Jan 7, 2022
@joshgoebel
Copy link
Member

Thanks.

brainlid added a commit to brainlid/highlight.js that referenced this pull request Feb 11, 2022
* master: (816 commits)
  (chore) add sideEffects: false to enable tree-shaking in esbuild & others
  fix(markdown) Handle `***Hello world***` without breaking (highlightjs#3457)
  (chore) DRY up php grammar just a little
  enh(php) support CSSCase attribute naming
  refactor, security issues
  enh(php) Add support for Attributes
  fix(java) prevent false variable init on `else` (highlightjs#3455)
  (ci) min change threshold for size report (highlightjs#3401)
  (themes) Add `tokyo-night-dark` (highlightjs#3467)
  enh(llvm) Improve number support, add `char.escape` (highlightjs#3471)
  (chore) simplify brainfuck grammar
  fix(brainfuck) fix highlighting of initial ++/--
  Minor change to TypeScript types and TypeScript-specific keywords (highlightjs#3466)
  fix(angelscript) Fix highlighting of int8, int16, int32, int64 (highlightjs#3464)
  enh(php) named arguments and fix php constants (highlightjs#3459)
  themes: add new felipec theme (highlightjs#3441)
  (chore) release 10.4.0
  enh(arcade) Add missing keywords for Arcade v1.16
  chore(arcade) eslint --fix, explode keywords
  enh(php) Left and right-side of double colon (highlightjs#3422)
  ...
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.

None yet

2 participants