bullet_train 1.37.0 → 1.37.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/docs/stylesheets.md +5 -1
- data/docs/themes.md +46 -0
- data/lib/bullet_train/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1dabb35a975775f9912af481e118c8e7a500e0ae622c10f50e999a2f22a86482
|
|
4
|
+
data.tar.gz: 946f16163a0e7a71530f7d4ce9cf71c593b1251fa9e4b2e645d023a048ba8917
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6f4d1a1cafc2d2087fea34ce131b809e154ee9a61d2fe42c9d0fcffd97ccbe7ef25a74d867ae77f780d70e06050ff94dc2c4a6af5ece94ece67179bcba0bb0e3
|
|
7
|
+
data.tar.gz: 1987c53b1c4d33badb48edf8202aba6d1d0a882f2e2df2863976d61960b48e2e31feb4ef6f0ba5dda980e8ad64744315a0c4f8cc0a78a98da2288ecba5725588
|
data/docs/stylesheets.md
CHANGED
|
@@ -13,4 +13,8 @@ You can eject only the theme files you wish to override or you can eject the who
|
|
|
13
13
|
|
|
14
14
|
To add your own custom CSS, add to the `app/assets/stylesheets/application.css` file found in your app. In this file, you'll be able to use Tailwind `@apply` directives and add `@import` statements to include the CSS from third-party `npm` packages.
|
|
15
15
|
|
|
16
|
-
For further modifications to the theme's style sheet (for example, to change the order in which base Tailwind stylesheets are included), you can eject the theme's css by using the command `rake bullet_train:themes:light:eject_css`.
|
|
16
|
+
For further modifications to the theme's style sheet (for example, to change the order in which base Tailwind stylesheets are included), you can eject the theme's css by using the command `rake bullet_train:themes:light:eject_css`.
|
|
17
|
+
|
|
18
|
+
## Using Custom Fonts
|
|
19
|
+
|
|
20
|
+
For information on customizing fonts in your application, see the [Customizing Fonts](/docs/themes.md#customizing-fonts) section in the Themes documentation.
|
data/docs/themes.md
CHANGED
|
@@ -52,6 +52,52 @@ themeConfig.theme.extend.colors = ({colors}) => ({
|
|
|
52
52
|
Here you need to include `primary` and `secondary` as well as `base`. The settings in `tailwind.config.js` will **mostly** clobber the settings
|
|
53
53
|
in `theme.rb`, but not entirely. So for the best results you should make sure that those two files agree about the primary and secondary colors.
|
|
54
54
|
|
|
55
|
+
## Customizing Fonts
|
|
56
|
+
|
|
57
|
+
By default, Bullet Train uses [Inter](https://rsms.me/inter/) as its font family. You can customize this to use your own fonts.
|
|
58
|
+
|
|
59
|
+
### Removing the Default Font
|
|
60
|
+
|
|
61
|
+
To remove the default Inter font, which appears as a stylesheet `<link>` tag in the `<head>`, you'll need to eject the `shared/layouts/head/_fonts.html.erb` partial locally and modify or remove the link tag. To eject this partial, use `bin/resolve shared/layouts/head/fonts --eject` (see [Dealing with Indirection](#dealing-with-indirection) below for more details).
|
|
62
|
+
|
|
63
|
+
Once ejected to `app/views/themes/light/layouts/head/_fonts.html.erb` (or your custom theme directory), you can remove the stylesheet `<link>` tag.
|
|
64
|
+
|
|
65
|
+
### Adding a Custom Font
|
|
66
|
+
|
|
67
|
+
To add your own custom fonts, hosted locally:
|
|
68
|
+
|
|
69
|
+
_Note: if you'd like to use a CDN-hosted font different than `inter`, you can replace the stylesheet `<link>` tag for inter found in the head (see Removing the Default Font above) and skip to step 3 below on updating the Tailwind config._
|
|
70
|
+
|
|
71
|
+
1. **Add font files** to your application's `app/assets/fonts/` directory.
|
|
72
|
+
|
|
73
|
+
2. **Add `@font-face` rules** in your `app/assets/stylesheets/application.css` file:
|
|
74
|
+
|
|
75
|
+
```css
|
|
76
|
+
@font-face {
|
|
77
|
+
font-family: 'YourFontName';
|
|
78
|
+
src: url('YourFontFile.woff2') format('woff2');
|
|
79
|
+
font-weight: normal;
|
|
80
|
+
font-style: normal;
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Note: When you use `url('FontFileName.woff2')`, Propshaft will automatically replace it with a full fingerprinted public path to the font file.
|
|
85
|
+
|
|
86
|
+
3. **Update `tailwind.config.js`** to use your custom font in the Tailwind configuration:
|
|
87
|
+
|
|
88
|
+
```javascript
|
|
89
|
+
const defaultTheme = require('tailwindcss/defaultTheme')
|
|
90
|
+
|
|
91
|
+
// ... existing config ...
|
|
92
|
+
|
|
93
|
+
themeConfig.theme.extend.fontFamily.sans = [
|
|
94
|
+
'YourFontName',
|
|
95
|
+
...defaultTheme.fontFamily.sans,
|
|
96
|
+
]
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
This configuration sets your custom font as the primary sans-serif font while keeping the default system font stack as fallbacks.
|
|
100
|
+
|
|
55
101
|
## The Theme Subsystem
|
|
56
102
|
|
|
57
103
|
Bullet Train has a theme subsystem designed to allow you the flexibility to either extend or completely replace the stock “Light” UI theme.
|
data/lib/bullet_train/version.rb
CHANGED