Skip to content

Commit e490175

Browse files
authored
Merge pull request #9 from svelte-plugins/font
✨ feat(font): add includeFont to api
2 parents a37a54a + f34d25a commit e490175

File tree

4 files changed

+25
-4
lines changed

4 files changed

+25
-4
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ Try it in the [Svelte REPL](https://svelte.dev/repl/cae0ce6e92634878b6e1a587146d
7777
| enablePastDates | If disabled, the picker will prevent the user from selecting anything prior to today. | `boolean` (default: `true`)
7878
| theme | The theme name that should be assigned to the theme data-attribute. | `string` (default: `''`)
7979
| presetRanges | The array of present configs to replace the default set with. | `array` (default: [...])
80+
| includeFont | If false, the default Rubik font will not be loaded | `boolean` (default: `true`)
8081

8182
### Events
8283
| Prop | Description | Default |

docs/src/App.svelte

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,12 @@
273273
</ul>&rbrace;]
274274
</td>
275275
</tr>
276+
<tr>
277+
<td>includeFont</td>
278+
<td><code>boolean</code></td>
279+
<td>If false, the default font "Rubik" will not be loaded.</td>
280+
<td><code>true</code></td>
281+
</tr>
276282
</table>
277283
</section>
278284

@@ -304,6 +310,7 @@
304310
</section>
305311

306312
<br>
313+
307314
<section>
308315
<h2>Examples</h2>
309316
<p>Below are different examples of how you can configure the datepicker.</p>

src/datepicker.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,11 @@ export interface DatePickerProps {
140140
* An array of month labels.
141141
*/
142142
monthLabels?: string[];
143+
144+
/**
145+
* Determines if the default font "Rubik" should be loaded.
146+
*/
147+
includeFont?: boolean;
143148
}
144149

145150
export interface DatePickerEvents {

src/datepicker.svelte

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,12 @@
172172
'December'
173173
];
174174
175+
/**
176+
* Determines if the default font "Rubik" should be loaded.
177+
* @type {boolean}
178+
*/
179+
export let includeFont = true;
180+
175181
/**
176182
* The number of milliseconds in a day.
177183
* @type {number}
@@ -1064,10 +1070,12 @@
10641070
</div>
10651071
10661072
<svelte:head>
1067-
<link
1068-
rel="stylesheet"
1069-
href="https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;600;700;800;900&display=swap"
1070-
/>
1073+
{#if includeFont}
1074+
<link
1075+
rel="stylesheet"
1076+
href="https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;600;700;800;900&display=swap"
1077+
/>
1078+
{/if}
10711079
</svelte:head>
10721080
10731081
<style>

0 commit comments

Comments
 (0)