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

Implement Kratos UI for all flows #85

Merged
merged 20 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Refactor auth layout template
  • Loading branch information
TimVosch committed Jan 15, 2024
commit 6845dc3cd4cf755ca366981d38bbdebe370c0c61
60 changes: 60 additions & 0 deletions services/tenants/transports/webui/static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,14 @@ video {
width: 100%;
}

.max-w-lg {
max-width: 32rem;
}

.max-w-screen-lg {
max-width: 1024px;
}

.max-w-screen-md {
max-width: 768px;
}
Expand All @@ -640,6 +648,10 @@ video {
max-width: 640px;
}

.max-w-screen-xl {
max-width: 1280px;
}

.border-collapse {
border-collapse: collapse;
}
Expand All @@ -656,6 +668,10 @@ video {
grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-cols-\[1fr_4fr\] {
grid-template-columns: 1fr 4fr;
}

.flex-col {
flex-direction: column;
}
Expand Down Expand Up @@ -690,6 +706,12 @@ video {
margin-bottom: calc(1.5rem * var(--tw-space-y-reverse));
}

.space-y-8 > :not([hidden]) ~ :not([hidden]) {
--tw-space-y-reverse: 0;
margin-top: calc(2rem * calc(1 - var(--tw-space-y-reverse)));
margin-bottom: calc(2rem * var(--tw-space-y-reverse));
}

.overflow-hidden {
overflow: hidden;
}
Expand All @@ -706,6 +728,10 @@ video {
border-width: 2px;
}

.border-r {
border-right-width: 1px;
}

.border-secondary-500 {
--tw-border-opacity: 1;
border-color: rgb(47 69 92 / var(--tw-border-opacity));
Expand All @@ -731,6 +757,11 @@ video {
background-color: rgb(13 84 72 / var(--tw-bg-opacity));
}

.bg-red-500 {
--tw-bg-opacity: 1;
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
}

.bg-secondary-300 {
--tw-bg-opacity: 1;
background-color: rgb(130 143 157 / var(--tw-bg-opacity));
Expand All @@ -751,6 +782,11 @@ video {
background-color: rgb(19 28 37 / var(--tw-bg-opacity));
}

.bg-sky-50 {
--tw-bg-opacity: 1;
background-color: rgb(240 249 255 / var(--tw-bg-opacity));
}

.bg-white {
--tw-bg-opacity: 1;
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
Expand Down Expand Up @@ -786,6 +822,11 @@ video {
padding-right: 0.5rem;
}

.px-4 {
padding-left: 1rem;
padding-right: 1rem;
}

.px-6 {
padding-left: 1.5rem;
padding-right: 1.5rem;
Expand All @@ -811,6 +852,11 @@ video {
padding-bottom: 1rem;
}

.py-6 {
padding-top: 1.5rem;
padding-bottom: 1.5rem;
}

.text-center {
text-align: center;
}
Expand All @@ -834,6 +880,11 @@ video {
line-height: 1.25rem;
}

.text-xl {
font-size: 1.25rem;
line-height: 1.75rem;
}

.text-secondary-500 {
--tw-text-opacity: 1;
color: rgb(47 69 92 / var(--tw-text-opacity));
Expand Down Expand Up @@ -866,6 +917,11 @@ video {
transition-duration: 150ms;
}

.hover\:bg-gray-50:hover {
--tw-bg-opacity: 1;
background-color: rgb(249 250 251 / var(--tw-bg-opacity));
}

.hover\:bg-secondary-500:hover {
--tw-bg-opacity: 1;
background-color: rgb(47 69 92 / var(--tw-bg-opacity));
Expand All @@ -880,4 +936,8 @@ video {
.md\:max-w-\[420px\] {
max-width: 420px;
}

.md\:max-w-screen-lg {
max-width: 1024px;
}
}
1 change: 1 addition & 0 deletions services/tenants/transports/webui/views/error.qtpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{% code
type ErrorPage struct {
Flow *ory.FlowError
Base
} %}

{% func (p ErrorPage) Body() %}
Expand Down
35 changes: 18 additions & 17 deletions services/tenants/transports/webui/views/error.qtpl.go

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

29 changes: 20 additions & 9 deletions services/tenants/transports/webui/views/login.qtpl
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{% import ory "github.com/ory/client-go" %}
{% interface PageBody {
Body()
} %}
{% interface Page {
Body()
Template(p PageBody)
} %}

{% func Layout(p Page) %}

<!DOCTYPE html>
<html lang="en" class="bg-[#f8fafc]">
<head>
Expand All @@ -14,21 +17,29 @@
<link rel="stylesheet" href="{%s U("/static/style.css") %}" />
</head>
<body>
<main class="mt-12 mx-auto w-full md:max-w-[420px] bg-white rounded-md overflow-hidden">
<header class="bg-secondary-500 h-14 py-3">
<img src="{%s U("/static/logo-white.png") %}" alt="SensorBucket Logo" class="h-full mx-auto" />
</header>
<section class="px-6 mb-4 space-y-2">
{%= p.Body() %}
</section>
</main>
{%= p.Template(p) %}
</body>
</html>
{% endfunc %}

{% code
type Base struct {}
%}

{% func (b Base) Template(p PageBody) %}
<main class="mt-12 mx-auto w-full md:max-w-[420px] bg-white rounded-md overflow-hidden">
<header class="bg-secondary-500 h-14 py-3">
<img src="{%s U("/static/logo-white.png") %}" alt="SensorBucket Logo" class="h-full mx-auto" />
</header>
<section class="px-6 mb-4 space-y-2">
{%= p.Body() %}
</section>
</main>
{% endfunc %}

{% code
type LoginPage struct {
Base
Flow *ory.LoginFlow
} %}

Expand Down
Loading