This repository has been archived by the owner on Dec 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 975
Responsive tab / refactor to Aphrodite #6900
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,15 @@ const globalStyles = { | |
breakpointNarrowViewport: '600px', | ||
breakpointExtensionButtonPadding: '720px', | ||
breakpointSmallWin32: '650px', | ||
breakpointTinyWin32: '500px' | ||
breakpointTinyWin32: '500px', | ||
tab: { | ||
largeMedium: '83px', | ||
medium: '66px', | ||
mediumSmall: '53px', | ||
small: '42px', | ||
extraSmall: '33px', | ||
smallest: '19px' | ||
} | ||
}, | ||
color: { | ||
linkColor: '#0099CC', | ||
|
@@ -95,7 +103,9 @@ const globalStyles = { | |
navbarBraveButtonMarginLeft: '80px', | ||
navbarLeftMarginDarwin: '76px', | ||
sideBarWidth: '190px', | ||
aboutPageSectionPadding: '24px' | ||
aboutPageSectionPadding: '24px', | ||
defaultTabPadding: '0 4px', | ||
defaultIconPadding: '0 2px' | ||
}, | ||
shadow: { | ||
switchShadow: 'inset 0 1px 4px rgba(0, 0, 0, 0.35)', | ||
|
@@ -136,6 +146,19 @@ const globalStyles = { | |
zindexSuggestionText: '3100', | ||
zindexWindowFullScreen: '4000', | ||
zindexWindowFullScreenBanner: '4100' | ||
}, | ||
fontSize: { | ||
tabIcon: '14px', | ||
tabTitle: '12px' | ||
}, | ||
appIcons: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👌 |
||
loading: 'fa fa-spinner fa-spin', | ||
defaultIcon: 'fa fa-file-o', | ||
closeTab: 'fa fa-times-circle', | ||
private: 'fa fa-eye', | ||
newSession: 'fa fa-user', | ||
volumeOn: 'fa fa-volume-up', | ||
volumeOff: 'fa fa-volume-off' | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
const {StyleSheet} = require('aphrodite') | ||
const globalStyles = require('./global') | ||
|
||
const styles = StyleSheet.create({ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Really well done here! 😄 This is perfect |
||
// Windows specific style | ||
tabForWindows: { | ||
color: '#555' | ||
}, | ||
|
||
tab: { | ||
background: 'linear-gradient(to bottom, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.1))', | ||
borderRadius: `${globalStyles.radius.borderRadiusTabs} ${globalStyles.radius.borderRadiusTabs} 0 0`, | ||
borderWidth: '1px 1px 0', | ||
borderStyle: 'solid', | ||
borderColor: 'transparent', | ||
boxSizing: 'border-box', | ||
color: '#3B3B3B', | ||
display: 'flex', | ||
height: '23px', | ||
marginTop: '2px', | ||
transition: 'transform 200ms ease', | ||
left: '0', | ||
opacity: '1', | ||
width: '100%', | ||
alignItems: 'center', | ||
justifyContent: 'space-between', | ||
padding: globalStyles.spacing.defaultTabPadding, | ||
position: 'relative', | ||
|
||
':hover': { | ||
background: 'linear-gradient(to bottom, rgba(255, 255, 255, 0.8), rgba(250, 250, 250, 0.4))' | ||
} | ||
}, | ||
|
||
// Custom classes based on tab's width and behaviour | ||
|
||
tabNarrowView: { | ||
padding: '0 2px' | ||
}, | ||
|
||
narrowViewPlayIndicator: { | ||
borderWidth: '2px 0 0', | ||
borderStyle: 'solid', | ||
borderColor: 'lightskyblue' | ||
}, | ||
|
||
tabNarrowestView: { | ||
justifyContent: 'center' | ||
}, | ||
|
||
tabMinAllowedSize: { | ||
padding: 0 | ||
}, | ||
|
||
tabIdNarrowView: { | ||
flex: 'inherit' | ||
}, | ||
|
||
tabIdMinAllowedSize: { | ||
overflow: 'hidden' | ||
}, | ||
|
||
// Add extra space for pages that have no icon | ||
// such as about:blank and about:newtab | ||
noFavicon: { | ||
padding: '0 6px' | ||
}, | ||
|
||
alternativePlayIndicator: { | ||
borderTop: '2px solid lightskyblue' | ||
}, | ||
|
||
tabId: { | ||
alignItems: 'center', | ||
display: 'flex', | ||
flex: '1', | ||
minWidth: '0' // @see https://bugzilla.mozilla.org/show_bug.cgi?id=1108514#c5 | ||
}, | ||
|
||
isPinned: { | ||
padding: globalStyles.spacing.defaultIconPadding | ||
}, | ||
|
||
active: { | ||
background: `linear-gradient(to bottom, #fff, ${globalStyles.color.chromePrimary})`, | ||
height: '25px', | ||
marginTop: '1px', | ||
boxShadow: '0 -1px 4px 0 rgba(51, 51, 51, 0.12)', | ||
borderWidth: '1px 1px 0', | ||
borderStyle: 'solid', | ||
borderColor: '#bbb', | ||
|
||
':hover': { | ||
background: `linear-gradient(to bottom, #fff, ${globalStyles.color.chromePrimary})` | ||
} | ||
}, | ||
|
||
activePrivateTab: { | ||
background: 'rgb(247, 247, 247)', | ||
color: 'black' | ||
}, | ||
|
||
private: { | ||
background: '#9c8dc1', // (globalStyles.color.privateTabBackground, 40%) | ||
color: '#fff', | ||
|
||
':hover': { | ||
background: '#665296', // (globalStyles.color.privateTabBackground, 20%) | ||
color: '#fff' | ||
} | ||
}, | ||
|
||
dragging: { | ||
':hover': { | ||
closeTab: { | ||
opacity: '0' | ||
} | ||
} | ||
} | ||
}) | ||
|
||
module.exports = styles |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is perfect! For anyone else looking at this... I believe this is the best way because there could be many variations of
navigator.platform
for Linux. We can't rely on process.platform because this code is often invoked in the renderer (like in this PR)