-
-
Notifications
You must be signed in to change notification settings - Fork 12
[2.x] Bundle styles to support more torchlight features #2039
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
[2.x] Bundle styles to support more torchlight features #2039
Conversation
Claude Sonnet via Cursor
Based on the provided code and context, I can help analyze whether to split out the Torchlight styles. Let me break this down:
@import 'hydefront/components/table-of-contents.css';
@import 'hydefront/components/heading-permalinks.css';
@import 'hydefront/components/torchlight.css';
@import 'hydefront/components/blockquotes.css';
'features' => [
// Page Modules
Feature::HtmlPages,
Feature::MarkdownPosts,
Feature::BladePages,
Feature::MarkdownPages,
Feature::DocumentationPages,
// Frontend Features
Feature::Darkmode,
Feature::DocumentationSearch,
// Integrations
Feature::Torchlight,
],
## Torchlight
Torchlight is an amazing API for syntax highlighting, and is used by this site. I cannot recommend it highly enough,
especially for documentation sites and code-heavy blogs! As such, HydePHP has built-in support for Torchlight,
which is automatically enabled once you add an API token to your `.env` file. Nothing else needs to be done!
### Getting started
To get started you need an API token which you can get at [Torchlight.dev](https://torchlight.dev/).
It is entirely free for personal and open source projects, as seen on their [pricing page](https://torchlight.dev/#pricing).
When you have an API token, set it in the `.env` file in the root directory of your project.
Once a token is set, Hyde will automatically enable the CommonMark extension.
```env
TORCHLIGHT_TOKEN=torch_<your-api-token>
```
Recommendation: I would recommend splitting the Torchlight styles into two files:
/* Basic Torchlight styles */
.prose .torchlight-link,
.torchlight-link {
text-decoration: underline;
}
/* Essential focusing styles */
.torchlight.has-focus-lines .line:not(.line-focus) {
transition: filter 0.35s, opacity 0.35s;
filter: blur(.095rem);
opacity: .65;
}
.torchlight.has-focus-lines:hover .line:not(.line-focus) {
filter: blur(0px);
opacity: 1;
}
/* Collapsing feature styles */
.torchlight summary:focus {
outline: none;
}
/* Rest of the collapsing styles... */ Rationale:
Implementation suggestion: /* Base torchlight.css */
@import 'torchlight/base.css';
@import 'torchlight/extended.css' (optional); This aligns with Hyde's "batteries included but removable" approach seen throughout the codebase. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## new-asset-system #2039 +/- ##
====================================================
Coverage 100.00% 100.00%
Complexity 1906 1906
====================================================
Files 195 195
Lines 5080 5080
====================================================
Hits 5080 5080 ☔ View full report in Codecov by Sentry. |
Meh, don't think it's worth the complexity to add an extra file for a single style. Gonna merge them |
No description provided.