Skip to content

Commit

Permalink
chore: self hosted font & icon assets
Browse files Browse the repository at this point in the history
  • Loading branch information
sensasi-delight committed Jun 27, 2024
1 parent 65c17f3 commit b710199
Show file tree
Hide file tree
Showing 55 changed files with 121 additions and 6 deletions.
42 changes: 42 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
"lint:fix": "prettier --write ."
},
"devDependencies": {
"@fontsource/material-icons": "^5.0.18",
"@fontsource/material-icons-outlined": "^5.0.12",
"@fontsource/material-icons-round": "^5.0.12",
"@fontsource/material-icons-sharp": "^5.0.12",
"@fontsource/material-icons-two-tone": "^5.0.12",
"@fontsource/roboto": "^5.0.13",
"@shufo/prettier-plugin-blade": "^1.14.1",
"material-components-web": "^14.0.0",
"prettier": "^3.3.2",
Expand Down
2 changes: 2 additions & 0 deletions src/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public static function generateAssetResponse(string $fileName, string $extName)
['Content-Type' => match ($extName) {
'css' => 'text/css',
'js' => 'application/javascript',
'woff2' => 'font/woff2',
'woff' => 'font/woff',
default => 'text/plain',
}]
);
Expand Down
2 changes: 1 addition & 1 deletion src/assets/dist/main.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/assets/dist/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added src/assets/dist/roboto-cyrillic-300-normal.woff
Binary file not shown.
Binary file added src/assets/dist/roboto-cyrillic-300-normal.woff2
Binary file not shown.
Binary file added src/assets/dist/roboto-cyrillic-400-normal.woff
Binary file not shown.
Binary file added src/assets/dist/roboto-cyrillic-400-normal.woff2
Binary file not shown.
Binary file added src/assets/dist/roboto-cyrillic-500-normal.woff
Binary file not shown.
Binary file added src/assets/dist/roboto-cyrillic-500-normal.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added src/assets/dist/roboto-greek-300-normal.woff
Binary file not shown.
Binary file added src/assets/dist/roboto-greek-300-normal.woff2
Binary file not shown.
Binary file added src/assets/dist/roboto-greek-400-normal.woff
Binary file not shown.
Binary file added src/assets/dist/roboto-greek-400-normal.woff2
Binary file not shown.
Binary file added src/assets/dist/roboto-greek-500-normal.woff
Binary file not shown.
Binary file added src/assets/dist/roboto-greek-500-normal.woff2
Binary file not shown.
Binary file added src/assets/dist/roboto-latin-300-normal.woff
Binary file not shown.
Binary file added src/assets/dist/roboto-latin-300-normal.woff2
Binary file not shown.
Binary file added src/assets/dist/roboto-latin-400-normal.woff
Binary file not shown.
Binary file added src/assets/dist/roboto-latin-400-normal.woff2
Binary file not shown.
Binary file added src/assets/dist/roboto-latin-500-normal.woff
Binary file not shown.
Binary file added src/assets/dist/roboto-latin-500-normal.woff2
Binary file not shown.
Binary file added src/assets/dist/roboto-latin-ext-300-normal.woff
Binary file not shown.
Binary file added src/assets/dist/roboto-latin-ext-300-normal.woff2
Binary file not shown.
Binary file added src/assets/dist/roboto-latin-ext-400-normal.woff
Binary file not shown.
Binary file added src/assets/dist/roboto-latin-ext-400-normal.woff2
Binary file not shown.
Binary file added src/assets/dist/roboto-latin-ext-500-normal.woff
Binary file not shown.
Binary file added src/assets/dist/roboto-latin-ext-500-normal.woff2
Binary file not shown.
Binary file added src/assets/dist/roboto-vietnamese-300-normal.woff
Binary file not shown.
Binary file not shown.
Binary file added src/assets/dist/roboto-vietnamese-400-normal.woff
Binary file not shown.
Binary file not shown.
Binary file added src/assets/dist/roboto-vietnamese-500-normal.woff
Binary file not shown.
Binary file not shown.
2 changes: 2 additions & 0 deletions src/assets/src/main.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@use 'systems/fonts.scss';

// base style
@use 'material-components-web';

Expand Down
65 changes: 65 additions & 0 deletions src/assets/src/systems/fonts.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
@use '@fontsource/roboto/300.css' as roboto300;
@use '@fontsource/roboto/400.css' as roboto400;
@use '@fontsource/roboto/500.css' as roboto500;

@use '@fontsource/material-icons';
@use '@fontsource/material-icons-outlined';
@use '@fontsource/material-icons-two-tone';
@use '@fontsource/material-icons-round';
@use '@fontsource/material-icons-sharp';

.material-icons {
font-family: 'Material Icons';
font-weight: normal;
font-style: normal;
font-size: 24px; /* Preferred icon size */
display: inline-block;
line-height: 1;
text-transform: none;
letter-spacing: normal;
word-wrap: normal;
white-space: nowrap;
direction: ltr;

/* Support for all WebKit browsers. */
-webkit-font-smoothing: antialiased;

/* Support for Safari and Chrome. */
text-rendering: optimizeLegibility;

/* Support for Firefox. */
-moz-osx-font-smoothing: grayscale;

/* Support for IE. */
font-feature-settings: 'liga';
}

/* Rules for sizing the icon. */
.material-icons.md-18 {
font-size: 18px;
}
.material-icons.md-24 {
font-size: 24px;
}
.material-icons.md-36 {
font-size: 36px;
}
.material-icons.md-48 {
font-size: 48px;
}

/* Rules for using icons as black on a light background. */
.material-icons.md-dark {
color: rgba(0, 0, 0, 0.54);
}
.material-icons.md-dark.md-inactive {
color: rgba(0, 0, 0, 0.26);
}

/* Rules for using icons as white on a dark background. */
.material-icons.md-light {
color: rgba(255, 255, 255, 1);
}
.material-icons.md-light.md-inactive {
color: rgba(255, 255, 255, 0.3);
}
5 changes: 1 addition & 4 deletions src/views/components/_assets.blade.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
<link
rel="stylesheet"
href="https://fonts.googleapis.com/icon?family=Material+Icons|Material+Icons+Outlined|Material+Icons+Two+Tone|Material+Icons+Round|Material+Icons+Sharp"
>
<link
rel="stylesheet"
href="{{ route('material-blade.assets', ['main', 'css']) }}"
>

<script
type="module"
src="{{ route('material-blade.assets', ['main', 'js']) }}"
Expand Down
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { defineConfig } from 'vite'

export default defineConfig({
base: '/assets/material-blade/',
build: {
rollupOptions: {
input: {
Expand Down

0 comments on commit b710199

Please sign in to comment.