Skip to content

Commit

Permalink
Improve header styles
Browse files Browse the repository at this point in the history
  • Loading branch information
n4bb12 committed Mar 3, 2019
1 parent 9021632 commit 158df85
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 11 deletions.
34 changes: 29 additions & 5 deletions src/client/login-button.css
Original file line number Diff line number Diff line change
@@ -1,18 +1,42 @@
/**
* Hide the "To publish your first package just:" section
* since it shows commands that don't work with oauth.
* since it shows commands that don't make sense with OAuth.
*/
[class^='src-webui-components-Help-help__noPkgIntro'] {
[class*='help__noPkgIntro'] {
display: none;
}

/**
* Limit width to prevent ugly push-out of login button
* Increase the header width.
*/
[class^='src-webui-components-Header-header__headerWrap'] figure {
[class*='header__header'] [class*='header__headerWrap'] {
padding: 0 1rem;
max-width: 1240px;
}

/**
* Show ellipsis when token is too long.
*/
[class*='header__headerWrap'] figure {
margin: 0 1rem;
max-width: 33vw;
overflow-x: hidden;
overflow-y: auto;
text-overflow: ellipsis;
}

/**
* Prevent wrapping of the welcome text.
*/
.user-logged {
display: flex;
align-items: center;
white-space: nowrap;
}

/**
* Prevent logo flicker while loading.
*/
[class*='header__logo'] {
width: 150.5px;
height: 50px;
}
13 changes: 7 additions & 6 deletions src/client/login-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,19 @@ interface QueryParams {

const updateUsageInfo = () => {
const info = getUsageInfo()
const element = document.querySelector("[class^='src-webui-components-Header-header'] figure")
const element = document.querySelector("[class^='src-webui-components-Header-header'] figure") as HTMLElement

if (element) {
element.innerHTML = info.join("<br>")
element.innerText = info.join("\n")
} else {
setTimeout(updateUsageInfo, 100)
}
}

/**
* By default the login button opens a form that asks the user to submit credentials.
* We replace this behaviour and instead redirect to the route that handles OAuth.
*/
//
// By default the login button opens a form that asks the user to submit credentials.
// We replace this behaviour and instead redirect to the route that handles OAuth.
//

const clickTargetHasClassname = (classname: string, e: any): boolean => {
const path = e.path || (e.composedPath && e.composedPath())
Expand Down

0 comments on commit 158df85

Please sign in to comment.