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

fix: stylesheet url support for appshell host #30

Merged
merged 1 commit into from
Jan 18, 2024
Merged
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 packages/react-host/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ APPSHELL_PRIMARY_COLOR=
APPSHELL_TITLE=My App
# Description of the application
APPSHELL_DESCRIPTION=Appshell React host
# Custom URL for global stylesheet (defaults to Google Roboto)
APPSHELL_STYLESHEET_URL=

APPSHELL_CONTAINER_SCALE=1
ENV_TARGET=
Expand Down
1 change: 1 addition & 0 deletions packages/react-host/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<meta name="description" content="<%=APPSHELL_DESCRIPTION%>" />
<link rel="apple-touch-icon" href="<%=APPSHELL_PUBLIC_URL%>/logo192.png" />
<link rel="manifest" href="<%=APPSHELL_PUBLIC_URL%>/manifest.json" />
<link rel="stylesheet" href="<%=APPSHELL_STYLESHEET_URL%>" />
<script src="<%=APPSHELL_PUBLIC_URL%>/appshell.env.js"></script>
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
Expand Down
1 change: 1 addition & 0 deletions packages/react-host/sample.env
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ APPSHELL_ENV_PREFIX=APPSHELL_
APPSHELL_ENV_GLOBAL_VAR=
APPSHELL_THEME_COLOR=
APPSHELL_PRIMARY_COLOR=
APPSHELL_STYLESHEET_URL=
APPSHELL_TITLE=My App
APPSHELL_DESCRIPTION=Hosted by Appshell React Host

Expand Down
2 changes: 1 addition & 1 deletion packages/react-host/src/reset.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
Expand Down
1 change: 1 addition & 0 deletions packages/react-host/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ module.exports = (env, { mode }) => {
APPSHELL_DESCRIPTION: JSON.stringify(process.env.APPSHELL_DESCRIPTION),
APPSHELL_PUBLIC_URL: JSON.stringify(process.env.APPSHELL_PUBLIC_URL),
APPSHELL_THEME_COLOR: JSON.stringify(process.env.APPSHELL_THEME_COLOR),
APPSHELL_STYLESHEET_URL: JSON.stringify(process.env.APPSHELL_STYLESHEET_URL || 'https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap'),
}),
new CopyPlugin({
patterns: [
Expand Down
Loading