Skip to content

Commit

Permalink
Custom look and feel (#7)
Browse files Browse the repository at this point in the history
* Custom look and feel

* Change omnipresent banner

* Hardcoded logo

* Add overrides spec

* Lint files

* Fix locales

* Simplify font styles
  • Loading branch information
fblupi authored Jan 19, 2024
1 parent 4423f4e commit c3d5bf4
Show file tree
Hide file tree
Showing 30 changed files with 423 additions and 2 deletions.
Binary file added app/packs/fonts/OpenSans-Italic.ttf
Binary file not shown.
Binary file added app/packs/fonts/OpenSans-Light.ttf
Binary file not shown.
Binary file added app/packs/fonts/OpenSans-LightItalic.ttf
Binary file not shown.
Binary file added app/packs/fonts/OpenSans-Medium.ttf
Binary file not shown.
Binary file added app/packs/fonts/OpenSans-MediumItalic.ttf
Binary file not shown.
Binary file added app/packs/fonts/OpenSans-Regular.ttf
Binary file not shown.
Empty file removed app/packs/images/.keep
Empty file.
Binary file added app/packs/images/aneca-logo-white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/packs/images/platoniq-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/packs/src/decidim/decidim_application.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@

// Load images
require.context("../../images", true)
require.context("../../fonts", true)
48 changes: 48 additions & 0 deletions app/packs/stylesheets/aneca.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
@font-face {
font-family: "OpenSans";
font-weight: 100 300;
src: url("fonts/OpenSans-Light.ttf") format("truetype");
}

@font-face {
font-family: "OpenSans";
font-style: italic;
font-weight: 100 300;
src: url("fonts/OpenSans-LightItalic.ttf") format("truetype");
}

@font-face {
font-family: "OpenSans";
font-weight: 400;
src: url("fonts/OpenSans-Regular.ttf") format("truetype");
}

@font-face {
font-family: "OpenSans";
font-style: italic;
font-weight: 400;
src: url("fonts/OpenSans-Italic.ttf") format("truetype");
}

@font-face {
font-family: "OpenSans";
font-weight: 500 900;
src: url("fonts/OpenSans-Medium.ttf") format("truetype");
}

@font-face {
font-family: "OpenSans";
font-style: italic;
font-weight: 500 900;
src: url("fonts/OpenSans-MediumItalic.ttf") format("truetype");
}

@import "aneca/variables";
@import "aneca/footer";
@import "aneca/navbar";
@import "aneca/body";
@import "aneca/buttons";
@import "aneca/cards";
@import "aneca/typography";
@import "aneca/orgchart";
@import "aneca/omnipresent_banner";
7 changes: 7 additions & 0 deletions app/packs/stylesheets/aneca/_body.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@import "./variables";

body,
.off-canvas-wrapper,
.home-section:nth-of-type(2n + 1) {
background-color: $body-background;
}
18 changes: 18 additions & 0 deletions app/packs/stylesheets/aneca/_buttons.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@import "./variables";

.button.hollow {
color: $color-green !important;
border-color: $color-green;
}

.button.hollow:hover {
color: $color-white !important;
}

.button {
color: $color-white;
}

.button:hover {
color: $color-white;
}
10 changes: 10 additions & 0 deletions app/packs/stylesheets/aneca/_cards.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@import "./variables";

.card__link {
color: $color-green70;
}

.card__link:hover {
color: $color-green70;
text-decoration: underline;
}
90 changes: 90 additions & 0 deletions app/packs/stylesheets/aneca/_footer.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
@import "./variables";

.footer {
background: $footer-bg;
}

.mini-footer,
.main-footer,
.eu-footer {
background: none;
}

.eu-footer {
.eu-disclaimer {
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;

.flag {
height: auto;
max-height: 8rem;
}

&__img {
width: 15rem;

img {
height: auto;
max-width: 100vw;
width: 15rem;
}
}

p {
font-size: .5rem;
margin-bottom: 0;
}
}

.row {
display: flex;
justify-content: center;
}
}

.mini-footer {
.logos {
display: flex;
flex-wrap: wrap;
align-items: end;
padding: 1rem;
}

.row {
display: flex;
align-items: center;
}
}

.main-footer,
.mini-footer {
a {
color: $color-white;

&:hover {
color: darken($color-white, 40%);
}
}

span {
color: $color-white;
}
}

.main__footer__social {
text-align: center;

@include breakpoint(medium) {
text-align: right;
}

p {
text-align: center !important;
margin-left: 25px;
margin-bottom: 0;
color: $color-white;
padding-top: .5rem;
}
}
92 changes: 92 additions & 0 deletions app/packs/stylesheets/aneca/_navbar.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
@import "./variables";

.title-bar {
background: $color-green;
color: $color-white;
}

.topbar__dropmenu > ul > li > a,
.topbar__admin__link a {
color: $color-white;
}

.topbar__user__login a:hover {
color: $color-white;
}

@media print, screen and (min-width: 40em) {
.topbar__user__login a,
.topbar__user__login a:hover {
color: $color-white;
}
}

.topbar__admin__link a span {
padding-left: .3rem;
}

.topbar__dropmenu .is-dropdown-submenu li a {
color: $color-green70;
}

.topbar__admin__link a:hover {
color: $color-white;
}

.topbar__notifications .icon,
.topbar__conversations .icon {
fill: $color-white;
opacity: .6;
}

.topbar__dropmenu > ul > li > a::after {
margin-top: -1px !important;
border-top-color: $color-white !important;
}

.dropdown.menu > li.is-active > a {
background: transparent;
color: $color-green70;
}

.logo-wrapper {
img {
max-height: 6rem;
}
}

.topbar__user {
display: inline-block;
padding-right: 2.5rem;
margin-left: 2rem;

@media (min-width: (1300 * .0625) + em) {
padding-right: 2.5rem;
}
}

.topbar__user__logged {
@media (min-width: (1300 * .0625) + em) {
padding-right: 2.5rem;
}
}

.main-nav__link a {
color: $color-white;
}

.main-nav__link--active a {
box-shadow: inset 0 4px 0 0 $color-green70;
}

.topbar__search input {
background: $color-gray;
}

.topbar__search:not(:focus-within) button {
background: $color-gray;
}

.navbar {
background: $color-gray;
}
5 changes: 5 additions & 0 deletions app/packs/stylesheets/aneca/_omnipresent_banner.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@import "./variables";

.omnipresent-banner {
background-color: $color-orange;
}
10 changes: 10 additions & 0 deletions app/packs/stylesheets/aneca/_orgchart.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@import "./variables";

.orgchart .as-text {
fill: $color-green70;
}

.card__link:hover {
color: $color-green70;
text-decoration: underline;
}
26 changes: 26 additions & 0 deletions app/packs/stylesheets/aneca/_typography.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@import "./variables";

a {
color: $color-green70;
}

a:hover {
color: $color-green70;
}

body,
h1,
.h1,
h2,
.h2,
h3,
.h3,
h4,
.h4,
h5,
.h5,
h6,
.h6 {
font-family: "OpenSans", "Arial", sans-serif;
font-weight: 300;
}
39 changes: 39 additions & 0 deletions app/packs/stylesheets/aneca/_variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
@function extract-rgb($color) {
@return red($color), green($color), blue($color);
}

$color-green: #007681;
$color-green70: #6b9ba3;
$color-gray: #888b8d;
$color-black: #000;
$color-orange: #e07e3c;
$color-white: #fff;
$success-color: #28a745;
$warning-color: #d39e00;
$alert-color: #dc3545;

$primary-color: $color-green;
$secondary-color: $color-gray;

$primary-color-rgb: extract-rgb($primary-color);
$secondary-color-rgb: extract-rgb($secondary-color);
$success-color-rgb: extract-rgb($success-color);
$warning-color-rgb: extract-rgb($warning-color);
$alert-color-rgb: extract-rgb($alert-color);

:root {
--primary: #{$primary-color};
--primary-rgb: #{$primary-color-rgb};
--secondary: #{$secondary-color};
--secondary-rgb: #{$secondary-color-rgb};
--success: #{$success-color};
--success-rgb: #{$success-color-rgb};
--warning: #{$warning-color};
--warning-rgb: #{$warning-color-rgb};
--alert: #{$warning-color};
--alert-rgb: #{$warning-color-rgb};
}

$body-background: $color-white;
$body-font-color: $color-black;
$footer-bg: $primary-color;
2 changes: 2 additions & 0 deletions app/packs/stylesheets/decidim/_decidim-settings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
// To override styles use decidim_application.scss
//
// By default this is empty.

@import "../aneca/variables";
2 changes: 2 additions & 0 deletions app/packs/stylesheets/decidim/decidim_application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
// To override CSS variables or Foundation settings use _decidim-settings.scss
//
// By default this is empty.

@import "stylesheets/aneca";
7 changes: 7 additions & 0 deletions app/views/layouts/decidim/_logo.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<% if organization %>
<%= link_to decidim.root_url(host: organization.host), "aria-label": t("front_page_link", scope: "decidim.accessibility") do %>
<%= image_pack_tag("media/images/aneca-logo-white.png", alt: t("logo", scope: "decidim.accessibility", organization: organization.name)) %>
<% end %>
<% else %>
<%= image_pack_tag("media/images/aneca-logo-white.png", alt: t("logo", scope: "decidim.accessibility", organization: Decidim.application_name)) %>
<% end %>
Loading

0 comments on commit c3d5bf4

Please sign in to comment.