Skip to content
This repository has been archived by the owner on Sep 13, 2021. It is now read-only.

Commit

Permalink
navbar styles, two things still need to be refactored
Browse files Browse the repository at this point in the history
  • Loading branch information
davidw-dw authored and gka committed Sep 6, 2021
1 parent c319887 commit 2ba428f
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 28 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@babel/core": "^7.12.10",
"@babel/preset-env": "^7.12.11",
"@datawrapper/chart-core": "^8.41.1",
"@datawrapper/icons": "^1.5.1",
"@datawrapper/icons": "^1.5.2",
"@datawrapper/locales": "^1.2.6",
"@datawrapper/orm": "^3.25.0",
"@datawrapper/schemas": "^1.12.1",
Expand Down
19 changes: 18 additions & 1 deletion src/styles/customize.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@
}


// Navbar
/*
* Navbar
*/


// Navbar touch sizes adjustment

@include touch {
.navbar-menu {
Expand All @@ -31,6 +36,7 @@
}
}

// Navbar dekstop sizes adjustments

@include desktop {
.navbar-item.has-dropdown .navbar-item.has-dropdown .navbar-dropdown {
Expand All @@ -43,4 +49,15 @@
.navbar-item.has-dropdown .navbar-item.has-dropdown:hover .navbar-dropdown {
display: block;
}

// hide label for burger menu on desktop @@ needs to be refactored
.navbar-end>.navbar-item:last-child>.navbar-link {
.navbar-title {
display: none;
}
.icon {
font-size: 30px;
margin-right: 0;
}
}
}
12 changes: 6 additions & 6 deletions src/utils/header-links.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@ module.exports = {
// },
...(isGuest
? [
{
type: 'separator',
order: 69
},
{
svgIcon: 'sign-in',
title: 'Sign in',
type: 'login',
url: `/signin?ref=${request.path}`
},
{
type: 'separator',
order: 69
}
]
: [
Expand All @@ -117,8 +117,8 @@ module.exports = {
id: 'settings',
svgIcon: 'menu',
title: 'More',
style: 'something',
svgIconSize: '30px',
style: '', // need a class here instead of inline style
// svgIconSize: '30px',
// svgIconCrisp: true,
order: 95,
submenuItems: [
Expand Down
14 changes: 11 additions & 3 deletions src/views/layout/partials/SvgIcon.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script>
export let icon = 'api';
export let size = '1em';
export let size = '1em'; // need to refactor this
export let color = 'currentColor';
export let valign = 'sub';
export let crisp = false;
Expand All @@ -15,11 +15,11 @@
<span
class="icon {className}"
class:spin
style="height:{size}; width:{size}; vertical-align: {valign}; {spin
style="vertical-align: {valign}; {spin
? `animation-duration:${duration}; animation-timing-function: ${timing};`
: ''}"
>
<svg style="height:{size}; width:{size}" class="svg-{icon}-dims" class:crisp>
<svg class="svg-{icon}-dims" class:crisp>
<use style="fill: {color}" xlink:href="/lib/icons/symbol/svg/sprite.symbol.svg#{icon}" />
</svg>
</span>
Expand All @@ -39,4 +39,12 @@
.crisp {
shape-rendering: crispEdges;
}
:global(.icon) {
font-size: 1em;
}
.icon svg {
width: 1em;
height: 1em;
}
</style>
8 changes: 5 additions & 3 deletions src/views/layout/partials/header/NavBar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
class:is-arrowless={link.type !== 'visArchive'}
>
<NavBarIcon item={link} />
<span>{@html link.title || ''}</span></a
<span class="navbar-title">{@html link.title || ''}</span></a
>
<!-- navbar dropdown menu -->
<div class="navbar-dropdown is-right is-boxed">
Expand Down Expand Up @@ -97,7 +97,9 @@
style={subItem2.style}
>
<NavBarIcon item={subItem2} />
<span>{@html subItem2.title}</span>
<span class="navbar-title"
>{@html subItem2.title}</span
>
</a>
{/each}
</div>
Expand All @@ -108,7 +110,7 @@
href={subItem.url}
on:click={event => onNavItemClick(event, subItem)}
><NavBarIcon item={subItem} />
<span>{@html subItem.title || ''}</span></a
<span class="navbar-title">{@html subItem.title || ''}</span></a
>
{/if}
{/each}
Expand Down
3 changes: 2 additions & 1 deletion src/views/layout/partials/header/NavBarIcon.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</script>

{#if item.svgIcon}<SvgIcon
size={item.svgIconSize || '20px'}
size={item.svgIconSize}
crisp={!!item.svgIconCrisp}
valign="top"
icon={item.svgIcon}
Expand All @@ -15,5 +15,6 @@
:global(.navbar-item .icon) {
margin-right: 1ex;
color: var(--color-dw-scooter);
font-size: 20px;
}
</style>
4 changes: 2 additions & 2 deletions src/views/layout/partials/header/TeamSelect.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
icon="team{team.active ? '-check' : ''}"
size="20px"
/>
<span>{team.name}</span>
<span class="navbar-title">{team.name}</span>
</a>
{/each}
<a
Expand All @@ -48,7 +48,7 @@
icon="user{!$user.activeTeam ? '-check' : ''}"
size="20px"
/>
<span>{@html __('navbar / teams / no-team')}</span>
<span class="navbar-title">{@html __('navbar / teams / no-team')}</span>
</a>
{:else}
<a class="navbar-item has-text-weight-normal" href="/account/teams">
Expand Down
6 changes: 3 additions & 3 deletions src/views/layout/partials/header/VisArchive.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,18 @@
class:is-arrowless={link.type !== 'visArchive'}
>
<NavBarIcon item={link} />
<span>{@html link.title || ''}</span></a
<span class="navbar-title">{@html link.title || ''}</span></a
>

<div class="navbar-dropdown is-right is-boxed">
{#if !items.length}
<div class="has-text-grey is-size-7 has-text-centered">
<div class=" navbar-item has-text-grey is-size-7 has-text-centered">
<SvgIcon
valign="middle"
icon="loading-spinner"
timing="steps(12)"
duration="1s"
className="mr-2 is-size-6"
className="mr-2 is-size-6 has-text-grey"
spin
/> loading...
</div>
Expand Down
10 changes: 9 additions & 1 deletion static/datawrapper.css
Original file line number Diff line number Diff line change
Expand Up @@ -7719,6 +7719,9 @@ html {
width: 0.5em;
height: 0.5em; }

/*
* Navbar
*/
@media screen and (max-width: 1023px) {
.navbar-menu .navbar-item:not(:last-child), .navbar-menu .navbar-link {
border-radius: 0;
Expand All @@ -7735,4 +7738,9 @@ html {
top: -6px;
display: none; }
.navbar-item.has-dropdown .navbar-item.has-dropdown:hover .navbar-dropdown {
display: block; } }
display: block; }
.navbar-end > .navbar-item:last-child > .navbar-link .navbar-title {
display: none; }
.navbar-end > .navbar-item:last-child > .navbar-link .icon {
font-size: 30px;
margin-right: 0; } }

0 comments on commit 2ba428f

Please sign in to comment.