Skip to content

Commit

Permalink
♻️ refactor html templates to use custom css instead of bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
annashamray committed Nov 24, 2023
1 parent a2459cc commit bce224d
Show file tree
Hide file tree
Showing 7 changed files with 356 additions and 120 deletions.
259 changes: 259 additions & 0 deletions vng_api_common/static/vng_api_common/css/screen.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,259 @@
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
font-size: 1rem;
font-weight: 400;
line-height: 1.5;
color: var(--color-text);
}

*,
*::before,
*::after {
box-sizing: border-box;
}

.button {
display: inline-block;
text-align: center;
vertical-align: middle;
border: 1px solid transparent;
border-radius: 0.25rem;
padding: 0.375rem 0.75rem;
text-decoration: none;
}
.button--primary {
color: var(--color-lightest);
background-color: var(--color-primary);
border-color: var(--color-primary);
}
.button--primary:hover {
background-color: var(--color-primary-dark);
border-color: var(--color-primary-dark);
}
.button--secondary {
color: var(--color-lightest);
background-color: var(--color-secondary);
border-color: var(--color-secondary);
}
.button--secondary:hover {
background-color: var(--color-secondary-dark);
border-color: var(--color-secondary-dark);
}
.button--alert {
color: var(--color-lightest);
background-color: var(--color-alert);
border-color: var(--color-alert);
}
.button--alert:hover {
background-color: var(--color-alert-dark);
border-color: var(--color-alert-dark);
}

.card {
border: 1px solid var(--color-border);
border-radius: 0.25rem;
padding: 1.25rem;
}
.card__title {
margin-bottom: 0.75rem;
}

.cardlist {
display: flex;
flex-wrap: wrap;
justify-content: center;
margin-left: -15px;
margin-right: -15px;
margin-bottom: 1rem;
}
.cardlist__item {
position: relative;
width: 100%;
padding-left: 15px;
padding-right: 15px;
}
@media (min-width: 576px) {
.cardlist__item {
flex: 0 0 33.333333%;
max-width: 33.333333%;
}
}

.container {
width: 100%;
padding-right: 15px;
padding-left: 15px;
margin-right: auto;
margin-left: auto;
}
.container--center {
text-align: center;
}
@media (min-width: 576px) {
.container {
max-width: 540px;
}
}
@media (min-width: 768px) {
.container {
max-width: 720px;
}
}
@media (min-width: 992px) {
.container {
max-width: 960px;
}
}
@media (min-width: 1200px) {
.container {
max-width: 1140px;
}
}
@media (min-width: 1400px) {
.container {
max-width: 1320px;
}
}

.footer {
padding-top: 1.5rem;
border-top: 1px solid var(--color-border);
color: var(--color-muted);
}
.footer__row {
display: flex;
margin-left: -15px;
margin-right: -15px;
}
.footer__item {
position: relative;
width: 100%;
padding-right: 15px;
padding-left: 15px;
}
.footer__item--right {
text-align: right;
}
.footer__logo {
margin-bottom: 0.5rem;
}
.footer__logo img {
display: block;
vertical-align: middle;
}

.header {
text-align: center;
padding: 1rem;
margin-right: auto;
margin-left: auto;
}
.header__title {
font-size: 3.5rem;
font-weight: 300;
line-height: 1.2;
}
.header__description {
font-size: 1.25rem;
font-weight: 300;
}

a {
color: var(--color-link);
}

.link {
color: var(--color-link);
text-decoration: none;
}
.link:hover {
color: var(--color-link-hover);
text-decoration: underline;
}
.link--muted {
color: var(--color-muted);
}
.link--muted:hover {
color: var(--color-secondary-dark);
}

.list {
padding-left: 0;
list-style: None;
margin-top: 0;
margin-bottom: 1rem;
}

.table {
width: 100%;
margin-bottom: 1rem;
border-collapse: collapse;
text-align: left;
}
.table thead th {
padding: 0.75rem;
border-bottom: 2px solid var(--color-border);
border-top: 1px solid var(--color-border);
}
.table tbody td {
padding: 0.75rem;
border-top: 1px solid var(--color-border);
}
.table tbody tr:nth-of-type(2n+1) {
background-color: rgba(0, 0, 0, 0.05);
}

h1,
h2,
h3,
h4,
h5 {
margin-top: 0;
margin-bottom: 0.5rem;
line-height: 1.2;
font-weight: 500;
}

h1 {
font-size: 2.5rem;
}

h2 {
font-size: 2rem;
}

h5 {
font-size: 1.25rem;
}

p {
margin-top: 0;
margin-bottom: 1rem;
}

code {
font-size: 87.5%;
color: var(--color-code);
word-break: break-word;
font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

:root {
--color-darkest: #000;
--color-dark: #212529;
--color-light: #dee2e6;
--color-lightest: #fff;
--color-primary: #007bff;
--color-primary-dark: #0056b3;
--color-secondary: #6c757d;
--color-secondary-dark: #5a6268;
--color-alert: #dc3545;
--color-alert-dark: #c82333;
--color-link: var(--color-primary);
--color-link-hover: var(--color-primary-dark);
--color-text: var(--color-dark);
--color-muted: var(--color-secondary);
--color-border: var(--color-light);
--color-code: #e83e8c;
--color-background: var(--color-lightest);
}
16 changes: 5 additions & 11 deletions vng_api_common/templates/vng_api_common/includes/kanalen_card.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
<div class="col-sm-4">

<div class="card">
<div class="card-body">
<h5 class="card-title"><i class="fas fa-bullhorn"></i> Notificaties</h5>
<p class="card-text">Gebeurtenissen waarover dit component notificaties verstuurt.</p>
<a href="https://github.com/{{ settings.SELF_REPO }}/blob/{{ settings.SELF_BRANCH }}/src/notificaties.md" class="btn btn-primary">Notificaties</a>
</div>
</div>

</div>
<div class="card">
<h5 class="card__title"><i class="fas fa-bullhorn"></i> Notificaties</h5>
<p>Gebeurtenissen waarover dit component notificaties verstuurt.</p>
<a href="https://github.com/{{ settings.SELF_REPO }}/blob/{{ settings.SELF_BRANCH }}/src/notificaties.md" class="button button--primary">Notificaties</a>
</div>

38 changes: 14 additions & 24 deletions vng_api_common/templates/vng_api_common/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,60 +2,50 @@

{% block content %}

<div class="px-3 py-3 pt-md-5 pb-md-4 mx-auto text-center">
<h1 class="display-4">{{ settings.PROJECT_NAME }} startpunt</h1>
<p class="lead">{{ settings.SITE_TITLE }}</p>
<div class="header">
<h1 class="header__title">{{ settings.PROJECT_NAME }} startpunt</h1>
<p class="header__description">{{ settings.SITE_TITLE }}</p>
</div>

<div class="container text-center">
<div class="container container--center">

{% block docs %}

<h2>Documentatie</h2>

<div class="row justify-content-md-center">
<div class="cardlist">

{% block docs_oas %}
<div class="col-sm-4">

<div class="cardlist__item">
<div class="card">
<div class="card-body">
<h5 class="card-title"><i class="fas fa-wifi"></i> API specificatie</h5>
<p class="card-text">Technische API documentatie in de vorm van een Open API Specificatie (OAS).</p>
<a href="https://redocly.github.io/redoc/?url={{ settings.GITHUB_API_SPEC }}" class="btn btn-primary">API specificaties</a>
</div>
<h5 class="card__title"><i class="fas fa-wifi"></i> API specificatie</h5>
<p>Technische API documentatie in de vorm van een Open API Specificatie (OAS).</p>
<a href="https://redocly.github.io/redoc/?url={{ settings.GITHUB_API_SPEC }}" class="button button--primary">API specificaties</a>
</div>

</div>
{% endblock %}

{% block docs_scopes %}
<div class="col-sm-4">

<div class="cardlist__item">
<div class="card">
<div class="card-body">
<h5 class="card-title"><i class="fas fa-shield-alt"></i> API scopes</h5>
<p class="card-text">Alle scopes binnen deze API voor gebruik in JWT's t.b.v. autorisaties.</p>
<a href="https://github.com/{{ settings.SELF_REPO }}/blob/{{ settings.SELF_BRANCH }}/src/autorisaties.md" class="btn btn-primary">API scopes</a>
</div>
<h5 class="card__title"><i class="fas fa-shield-alt"></i> API scopes</h5>
<p>Alle scopes binnen deze API voor gebruik in JWT's t.b.v. autorisaties.</p>
<a href="https://github.com/{{ settings.SELF_REPO }}/blob/{{ settings.SELF_BRANCH }}/src/autorisaties.md" class="button button--primary">API scopes</a>
</div>

</div>
{% endblock %}

{% block extra_docs %}{% endblock %}

</div>
<p></p>

{% endblock %}

{% block extra_content %}{% endblock %}

{% block admin_link %}
<p></p>
<p>
<a href="{% url 'admin:index' %}" class="btn btn-sm btn-danger"><i class="fas fa-lock"></i> Beheer</a>
<a href="{% url 'admin:index' %}" class="button button--alert"><i class="fas fa-lock"></i> Beheer</a>
</p>
{% endblock %}

Expand Down
Loading

0 comments on commit bce224d

Please sign in to comment.