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

Move style from inline in template to a css file #21

Open
wants to merge 1 commit into
base: main
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
5 changes: 5 additions & 0 deletions config/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ sylius_ui:
alerts: '@SynoliaSyliusAdminOauthPlugin/alerts.html.twig'
google_oauth_button: '@SynoliaSyliusAdminOauthPlugin/google_auth_button.html.twig'
microsoft_oauth_button: '@SynoliaSyliusAdminOauthPlugin/microsoft_auth_button.html.twig'
sylius.admin.layout.stylesheets:
blocks:
stylesoauth:
template: "@SynoliaSyliusAdminOauthPlugin/_styles.html.twig"
enabled: true

twig:
globals:
Expand Down
26 changes: 26 additions & 0 deletions public/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.oAuthButtonBlock {
margin: 0.5rem 0 0.5rem 0;
align-items: center;
}

.microsoftOAuth button {
padding:8px;
background-color: white;
width: 100%;
border: 1px lightgray solid;
border-radius: 4px;
height: 2.8rem;
}

.microsoftOAuth a {
width: 100%;
display: flex;
color: black;
font-size: 1rem;
justify-content: center;
font-weight: lighter;
}

.microsoftOAuth img {
margin-right: .5rem;
}
1 change: 1 addition & 0 deletions templates/_styles.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<link rel="stylesheet" href="{{ asset('bundles/synoliasyliusadminoauthplugin/main.css') }}" />
2 changes: 1 addition & 1 deletion templates/google_auth_button.html.twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% if google_client_id is not null %}
<div style="margin: 0.5rem 0 0.5rem 0">
<div class="oAuthButtonBlock googleOAuth">
<script src="https://accounts.google.com/gsi/client" async defer></script>

<div id="g_id_onload"
Expand Down
10 changes: 5 additions & 5 deletions templates/microsoft_auth_button.html.twig
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{% if microsoft_client_id is not null %}
<div style="margin: 0.5rem 0 0.5rem 0; align-items: center">
<button style="padding:8px; background-color: white; width: 100%; border: 1px lightgray solid; border-radius: 4px; height: 2.8rem;" disabled>
<a href="{{ path('connect_admin_azure') }}" style="width: 100%; display: flex; color: black; font-size: 1rem; justify-content: center; font-weight: lighter">
<img style="margin-right: .5rem;" src="https://learn.microsoft.com/fr-fr/azure/active-directory/develop/media/howto-add-branding-in-apps/ms-symbollockup_mssymbol_19.png" alt="microsoft icon">
<span style="">{{ "sylius.authentication.admin.microsoft_login_button_label"|trans }}</span>
<div class="oAuthButtonBlock microsoftOAuth">
<button disabled>
<a href="{{ path('connect_admin_azure') }}">
<img src="https://learn.microsoft.com/fr-fr/azure/active-directory/develop/media/howto-add-branding-in-apps/ms-symbollockup_mssymbol_19.png" alt="microsoft icon">
<span>{{ "sylius.authentication.admin.microsoft_login_button_label"|trans }}</span>
</a>
</button>
</div>
Expand Down
Loading