Skip to content
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

[Example] Add custom icon font to the sulu admin build #111

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions assets/admin/app.js
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
// Add project specific javascript code and import of additional bundles here:

import './fonts/icomoon/style.css';
11 changes: 11 additions & 0 deletions assets/admin/fonts/icomoon/fonts/icomoon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/admin/fonts/icomoon/fonts/icomoon.ttf
Binary file not shown.
Binary file added assets/admin/fonts/icomoon/fonts/icomoon.woff
Binary file not shown.
1 change: 1 addition & 0 deletions assets/admin/fonts/icomoon/selection.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"IcoMoonType":"selection","icons":[{"icon":{"paths":["M704 64l-320 320h-192l-192 256c0 0 203.416-56.652 322.066-30.084l-322.066 414.084 421.902-328.144c58.838 134.654-37.902 328.144-37.902 328.144l256-192v-192l320-320 64-320-320 64z"],"attrs":[{}],"isMulticolor":false,"isMulticolor2":false,"tags":["rocket","jet","speed","spaceship","fast"],"grid":16},"attrs":[{}],"properties":{"order":1,"id":0,"prevSize":32,"code":59648,"name":"rocket"},"setIdx":0,"setId":0,"iconIdx":0}],"height":1024,"metadata":{"name":"icomoon"},"preferences":{"showGlyphs":true,"showCodes":false,"showQuickUse":true,"showQuickUse2":true,"showSVGs":true,"fontPref":{"prefix":"su-app-","metadata":{"fontFamily":"icomoon","majorVersion":1,"minorVersion":0},"metrics":{"emSize":1024,"baseline":14,"whitespace":60},"embed":false,"ie7":false,"noie8":true,"includeMetadata":false,"cssVars":false,"cssVarsFormat":"scss","showSelector":true,"showMetrics":true,"showMetadata":true,"showVersion":true,"selector":"","classSelector":".icon"},"imagePref":{"prefix":"icon-","png":true,"useClassSelector":true,"color":0,"bgColor":16777215,"name":"icomoon","classSelector":".icon"},"historySize":50,"gridSize":16,"showLiga":true,"showGrid":false}}
29 changes: 29 additions & 0 deletions assets/admin/fonts/icomoon/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
@font-face {
font-family: 'icomoon';
src:
url('fonts/icomoon.ttf?sbssi4') format('truetype'),
url('fonts/icomoon.woff?sbssi4') format('woff'),
url('fonts/icomoon.svg?sbssi4#icomoon') format('svg');
font-weight: normal;
font-style: normal;
font-display: block;
}

[class^="su-app-"], [class*=" su-app-"] {
/* use !important to prevent issues with browser extensions that change fonts */
font-family: 'icomoon' !important;
speak: never;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;

/* Better Font Rendering =========== */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

.su-app-rocket:before {
content: "\e900";
}
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
1 change: 0 additions & 1 deletion public/build/admin/main.a5a185ce48d4ebdd1c1b.js.map

This file was deleted.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions public/build/admin/main.f9910b7d67f7d87e2118.js.map

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions public/build/admin/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"main.css": "/build/admin/main.a5a185ce48d4ebdd1c1b.css",
"main.js": "/build/admin/main.a5a185ce48d4ebdd1c1b.js",
"main.js.map": "/build/admin/main.a5a185ce48d4ebdd1c1b.js.map",
"main.css": "/build/admin/main.f9910b7d67f7d87e2118.css",
"main.js": "/build/admin/main.f9910b7d67f7d87e2118.js",
"main.js.map": "/build/admin/main.f9910b7d67f7d87e2118.js.map",
"build/admin/fonts/fa-brands-400.woff": "/build/admin/fonts/fa-brands-400.2285773e6b4b172f07d9b777c81b0775.woff",
"build/admin/fonts/fa-brands-400.eot": "/build/admin/fonts/fa-brands-400.23f19bb08961f37aaf692ff943823453.eot",
"build/admin/fonts/fa-brands-400.svg": "/build/admin/fonts/fa-brands-400.2f517e09eb2ca6650ff5bec5a95157ab.svg",
Expand All @@ -17,6 +17,9 @@
"build/admin/fonts/fa-solid-900.eot": "/build/admin/fonts/fa-solid-900.9bbb245e67a133f6e486d8d2545e14a5.eot",
"build/admin/fonts/fa-solid-900.ttf": "/build/admin/fonts/fa-solid-900.be9ee23c0c6390141475d519c2c5fb8f.ttf",
"build/admin/fonts/fa-solid-900.woff": "/build/admin/fonts/fa-solid-900.eeccf4f66002c6f2ba24d3d22f2434c2.woff",
"build/admin/fonts/icomoon.ttf?sbssi4": "/build/admin/fonts/icomoon.20a6a814f0555d2045a28e8ff4a9f9b1.ttf",
"build/admin/fonts/icomoon.svg?sbssi4": "/build/admin/fonts/icomoon.5b84696d9af122325f4410f5cc82bbd8.svg",
"build/admin/fonts/icomoon.woff?sbssi4": "/build/admin/fonts/icomoon.61785a1b19ac3573fd6805bf71cd0965.woff",
"build/admin/fonts/open-sans-v15-latin-300.ttf": "/build/admin/fonts/open-sans-v15-latin-300.252a41f69d4c320154a12092f6fbbedd.ttf",
"build/admin/fonts/open-sans-v15-latin-300.eot": "/build/admin/fonts/open-sans-v15-latin-300.2aeabc9e8ed0aef227d72fee83c14462.eot",
"build/admin/fonts/open-sans-v15-latin-300.svg": "/build/admin/fonts/open-sans-v15-latin-300.bb3b405a4608d51ddb1306c2f641f3dd.svg",
Expand Down
2 changes: 1 addition & 1 deletion src/Admin/AlbumAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function configureNavigationItems(NavigationItemCollection $navigationIte
{
if ($this->securityChecker->hasPermission(Album::SECURITY_CONTEXT, PermissionTypes::EDIT)) {
$rootNavigationItem = new NavigationItem('app.music');
$rootNavigationItem->setIcon('fa-music');
$rootNavigationItem->setIcon('su-app-rocket');
$rootNavigationItem->setPosition(25);

$navigationItem = new NavigationItem('app.albums');
Expand Down
Loading