-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update page template picker after design review (#20883)
* Make title bar smaller * Introduce new usePreferredColorSchemeStyle hook * Add top space to template previews * Adjust height of preview header and refactor a bit * Fix typo in useViewportMatch documentation Co-authored-by: Pinar Olguc <[email protected]>
- Loading branch information
Showing
6 changed files
with
64 additions
and
10 deletions.
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
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 |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
} | ||
|
||
.subtitleBar { | ||
height: 64px; | ||
height: 56px; | ||
} | ||
|
||
.leftContainer { | ||
|
33 changes: 33 additions & 0 deletions
33
packages/compose/src/hooks/use-preferred-color-scheme-style/index.native.js
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,33 @@ | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import usePreferredColorScheme from '../use-preferred-color-scheme'; | ||
|
||
/** | ||
* Selects which of the passed style objects should be applied depending on the | ||
* user's preferred color scheme. | ||
* | ||
* The "light" color schemed is assumed to be the default, and its styles are | ||
* always applied. The "dark" styles will always extend those defined for the | ||
* light case. | ||
* | ||
* @example | ||
* const light = { padding: 10, backgroundColor: 'white' }; | ||
* const dark = { backgroundColor: 'black' }; | ||
* usePreferredColorSchemeStyle( light, dark); | ||
* // On light mode: | ||
* // => { padding: 10, backgroundColor: 'white' } | ||
* // On dark mode: | ||
* // => { padding: 10, backgroundColor: 'black' } | ||
* @param {Object} lightStyle | ||
* @param {Object} darkStyle | ||
* @return {Object} the combined styles depending on the current color scheme | ||
*/ | ||
const usePreferredColorSchemeStyle = ( lightStyle, darkStyle ) => { | ||
const colorScheme = usePreferredColorScheme(); | ||
const isDarkMode = colorScheme === 'dark'; | ||
|
||
return isDarkMode ? { ...lightStyle, ...darkStyle } : lightStyle; | ||
}; | ||
|
||
export default usePreferredColorSchemeStyle; |
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