david-griffiths/nova-dark-theme
Composer 安装命令:
composer require david-griffiths/nova-dark-theme
包简介
A dark theme for Laravel Nova
README 文档
README
Nova Dark Theme
A dark theme for Laravel Nova to save your tired eyes 👀
Installation
First use composer to pull in the project:
composer require david-griffiths/nova-dark-theme
(Remember that you can install multiple themes with Nova. So you don't have to choose between this and another.)
Next you need to activate dark mode. To help you, there are several convenience commands included...
Add/Remove Toggle Switch From Menu
This is probably what you're looking for, as it lets you easily turn on dark mode at night.
php artisan nova-dark-theme:add-switch
If you've not made an over-writeable copy of Nova's user menu (the one in the top right), this command does that first of all. Then it adds the Vue component, which will look like this:
<li>
<nova-dark-theme-toggle
label="{{ __('Dark Theme') }}"
></nova-dark-theme-toggle>
</li>
</ul>
</dropdown-menu>
To remove the switch from your menu, you could edit the file yourself, or run this:
php artisan nova-dark-theme:remove-switch
Set Dark Mode On/Off By Default
This can be used with the toggle switch or without it. If you're not using the toggle switch then when you set dark mode ON, it will stay on and not be changeable by users. If you are using the switch, then the below commands will only set the theme state when the page first loads. The user will then be able to flip the switch whenever they like.
php artisan nova-dark-theme:on
php artisan nova-dark-theme:off
These commands add or remove a css class called nova-dark-theme from the HTML tag in Nova's main layout template.
Again, we copy this file to your resources directory (if you've not done so already) before making the change.
(:exclamation: You might need to run php artisan view:clear or php artisan view:cache before seeing the results)
How The CSS Works
We use a css filter to invert the colors, then some manual tweaks for the sidebar and logo areas. So white becomes black, which you should keep in mind when adding any custom css colors.
Code Fields
One item it doesn't style for you is the Nova Code field. I don't want impose a CodeMirror theme on you when you can pick one from here and set it like this:
Code::make('MyTextField')->options(['theme' => 'base16-light'])
(:exclamation: Remember to pick a light coloured CodeMirror theme if you want it to appear dark in Nova after the colors get inverted)
License
MIT License (MIT). Please see License File for more.
david-griffiths/nova-dark-theme 适用场景与选型建议
david-griffiths/nova-dark-theme 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 596.6k 次下载、GitHub Stars 达 71, 最近一次更新时间为 2019 年 01 月 29 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「theme」 「nova」 「laravel」 「dark」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 david-griffiths/nova-dark-theme 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 david-griffiths/nova-dark-theme 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 david-griffiths/nova-dark-theme 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Laravel Nova card that shows you your system information.
A Laravel Nova card.
A Laravel Nova package for publishable fields
A Laravel Nova package for translatable fields
A Bootstrap 4.x base theme for SilverStripe
A Laravel Nova Image field. you can paste or drag or chose an image
统计信息
- 总下载量: 596.6k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 71
- 点击次数: 25
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-01-29
