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

- feat: update google fonts to material symbols #4085

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
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: 1 addition & 1 deletion packages/create-vuestic/src/steps/2.addVuestic/vue-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const addVuesticToVue3App = async () => {
let htmlSource = await readFile(htmlPath, 'utf-8')
htmlSource = insertHead(htmlSource, [
`<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro&family=Source+Sans+Pro:wght@400;700&display=swap" rel="stylesheet">`,
`<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">`
`<link href="https://fonts.googleapis.com/icon?family=Material+Symbols+Outlined" rel="stylesheet">`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to update IconsConfig to use material-symbols but default, instead of material icons.
I expect updating nuxt module in my project and all icons still work, even if the're symbols now.

Right now, creating new vuestic project will install Material Symbols, but we use material-icons in IconsConfig...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should release both projects simultaneously then.

])
await writeFile(htmlPath, htmlSource)
}
3 changes: 1 addition & 2 deletions packages/docs/assets/icon-fonts/icon-fonts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@
@import "ionicons/dist/scss/ionicons.scss";

// Material Icons
@import url(https://fonts.googleapis.com/icon?family=Material+Icons);
@import url(https://fonts.googleapis.com/icon?family=Material+Icons+Outlined);
@import url(https://fonts.googleapis.com/icon?family=Material+Symbols+Outlined);
2 changes: 1 addition & 1 deletion packages/docs/components/Play.client.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const TAILWIND_CDN = '<script src="https://cdn.tailwindcss.com"><\/script>'
const previewOptions = computed<ReplProps['previewOptions']>(() => ({
headHTML: `
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro&family=Source+Sans+Pro:wght@400;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Symbols+Outlined" rel="stylesheet">
<link rel="stylesheet" href="${window.location.origin + '/vuestic-out/style.css'}">
<style>
body {
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/composables/code-sandbox/generators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const getCodeSandboxHtml = ({ requireIcons = false }: CodeSandboxConfig):
rel="stylesheet"
>
<link
href="https://fonts.googleapis.com/icon?family=Material+Icons"
href="https://fonts.googleapis.com/icon?family=Material+Symbols+Outlined"
rel="stylesheet"
>
<link
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ In future we also plan to be :
### Fonts

* General text: `https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700`
* Icons: `https://fonts.googleapis.com/icon?family=Material+Icons`
* Icons: `https://fonts.googleapis.com/icon?family=Material+Symobls+Outlined`

## Code style

Expand Down
3 changes: 1 addition & 2 deletions packages/docs/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@ export default defineNuxtConfig({
'Source+Code+Pro': {
wght: [400],
},
'Material+Icons': true,
'Material+Icons+Outlined': true,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did a quick check with docs, look fine

'Material+Symbols+Outlined': true,
},
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/icon?family=Material+Icons"
href="https://fonts.googleapis.com/icon?family=Material+Symbols+Outlined"
rel="stylesheet"
/>
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@import url("https://fonts.googleapis.com/css2?family=Source+Sans+Pro:ital,wght@0,400;1,700&display=swap");
@import url("https://fonts.googleapis.com/icon?family=Material+Icons");
@import url("https://fonts.googleapis.com/icon?family=Material+Symbols+Outlined");
2 changes: 1 addition & 1 deletion packages/docs/page-config/services/icons-config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default definePageConfig({

block.headline("Interactive playground"),
block.paragraph("Here you can see how your code will be transformed with different icon configs. You can change icon config params to see how it impact on final render. See our presets before play."),
block.alert("By default Vuestic require only Material Icons. Other icon libraries you need to setup yourself.", "info"),
block.alert("By default Vuestic require only Material Symbols Outlined. Other icon libraries you need to setup yourself.", "info"),
block.component("playground"),

// aliases
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<p>
Material Design Icons<br>
<VaIcon class="material-icons">
<VaIcon class="material-symbols-outlined">
book
</VaIcon>
<VaIcon name="book" />
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/page-config/ui-elements/icon/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default definePageConfig({
requireIcons: true,
},
}),
block.alert("Notice that Vuestic UI uses only Material Icons by default. You need to manually install additional libraries.", "warning"),
block.alert("Notice that Vuestic UI uses only Material Symbols Outlined by default. You need to manually install additional libraries.", "warning"),
block.example("Color", {
title: "Color",
description: "Set different colors using the `color` prop. You can either use a theme string or the HEX color value."
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt/src/composables/use-css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { VuesticOptions } from "../types";

const VUESTIC_DEFAULT_FONTS = [
{ rel: 'stylesheet', href: 'https://fonts.googleapis.com/css2?family=Source+Sans+Pro:ital,wght@0,400;1,700&display=swap' },
{ rel: 'stylesheet', href: 'https://fonts.googleapis.com/icon?family=Material+Icons&display=swap' }
{ rel: 'stylesheet', href: '(https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined' }
]

const registerDefaultFonts = (nuxt: Nuxt) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/nuxt/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export interface VuesticOptions {
*
* If `false` you will need to install fonts manually. If you're going to use different font, don't forget to change `--va-font-family` CSS variable.
*
* @notice this option adds `Source Sans Pro` and `Material Icons` fonts.
* @notice this option adds `Source Sans Pro` and `Material Symbols Outlined` fonts.
*
* @default true
*
Expand All @@ -36,7 +36,7 @@ export interface VuesticOptions {

/**
* Vuestic will automatically store its theme in cookies. If you want to change the key, you can do it here.
*
*
* @default 'vuestic-theme'
*/
themeCookieKey: string
Expand Down
6 changes: 1 addition & 5 deletions packages/sandbox/web-components/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@
/>
<link
rel="stylesheet"
href="https://fonts.googleapis.com/icon?family=Material+Icons"
/>
<link
rel="stylesheet"
href="https://fonts.googleapis.com/icon?family=Material+Icons+Outlined"
href="https://fonts.googleapis.com/icon?family=Material+Symbols+Outlined"
/>
</head>
<body>
Expand Down
1 change: 0 additions & 1 deletion packages/ui/.storybook/assets/fonts.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Fonts //
@import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600,700);
@import url(https://fonts.googleapis.com/icon?family=Material+Icons);
@import url(https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined);

body {
Expand Down
2 changes: 0 additions & 2 deletions packages/ui/.storybook/assets/icons/icons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,4 @@ $fa-font-path: "@fortawesome/fontawesome-free/webfonts";
@import "@fortawesome/fontawesome-free/scss/regular.scss";

// material icons
@import url(https://fonts.googleapis.com/icon?family=Material+Icons);
@import url(https://fonts.googleapis.com/icon?family=Material+Icons+Outlined);
@import url(https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined);
2 changes: 1 addition & 1 deletion packages/ui/src/components/va-icon/VaIcon.demo.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<VbDemo>
<VbCard title="MD">
<va-icon class="material-icons">home</va-icon>
<va-icon class="material-symbols-outlined">home</va-icon>
<va-icon name="home" />
</VbCard>
<VbCard title="MSO">
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/src/services/icon/presets/fonts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { IconConfig } from '../types'
export const VuesticIconFonts: IconConfig = [
{
name: 'mi-{icon}',
class: 'material-icons',
class: 'material-symbols-outlined',
resolve: ({ icon }) => ({ content: icon }),
},
// Fallback
{
name: '{icon}',
class: 'material-icons',
class: 'material-symbols-outlined',
resolve: ({ icon }) => ({ content: icon }),
},
]
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
---
<head>
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro&family=Source+Sans+Pro:wght@400;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Symbols+Outlined" rel="stylesheet">
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
---
<head>
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro&family=Source+Sans+Pro:wght@400;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Symbols+Outlined" rel="stylesheet">
Loading