Skip to content

Commit f065f63

Browse files
committed
feat(photo-browser): m3 styles
1 parent 33ad94a commit f065f63

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

src/core/components/app/app-vars.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
--f7-line-height: 1.5;
9797
--f7-bars-border-color: transparent;
9898
--f7-bars-bg-color: var(--f7-md-surface-2);
99+
--f7-bars-bg-color-rgb: var(--f7-md-surface-2-rgb);
99100
.light-vars({
100101
--f7-text-color: #212121;
101102
});

src/core/components/photo-browser/photo-browser-class.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,7 @@ class PhotoBrowser extends Framework7Class {
189189
const pb = this;
190190
if (pb.params.renderNavbar) return pb.params.renderNavbar.call(pb);
191191

192-
let iconsColor = pb.params.iconsColor;
193-
if (!pb.params.iconsColor && pb.params.theme === 'dark') iconsColor = 'white';
192+
const iconsColor = pb.params.iconsColor;
194193

195194
const pageBackLinkText =
196195
pb.app.theme === 'ios' && pb.params.pageBackLinkText ? pb.params.pageBackLinkText : '';
@@ -240,8 +239,7 @@ class PhotoBrowser extends Framework7Class {
240239
const pb = this;
241240
if (pb.params.renderToolbar) return pb.params.renderToolbar.call(pb);
242241

243-
let iconsColor = pb.params.iconsColor;
244-
if (!pb.params.iconsColor && pb.params.theme === 'dark') iconsColor = 'white';
242+
const iconsColor = pb.params.iconsColor;
245243

246244
return (
247245
<div class="toolbar toolbar-bottom tabbar">

src/core/components/photo-browser/photo-browser-vars.less

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
:root {
22
--f7-photobrowser-bg-color: #fff;
3-
/*
43
--f7-photobrowser-bars-bg-color: rgba(var(--f7-bars-bg-color-rgb), 0.95);
54
--f7-photobrowser-bars-text-color: var(--f7-bars-text-color);
65
--f7-photobrowser-bars-link-color: var(--f7-bars-link-color);
7-
*/
86
--f7-photobrowser-caption-font-size: 14px;
97
--f7-photobrowser-caption-light-text-color: #000;
108
--f7-photobrowser-caption-light-bg-color: rgba(255, 255, 255, 0.8);

src/core/shared/utils.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,16 @@ export function colorThemeCSSProperties(...args) {
351351
const shadeTintIos = getShadeTintColors(rgb);
352352
const shadeTintMdLight = getShadeTintColors(colorHexToRgb(light['--f7-md-primary']));
353353
const shadeTintMdDark = getShadeTintColors(colorHexToRgb(dark['--f7-md-primary']));
354+
Object.keys(light).forEach((key) => {
355+
if (key.includes('surface-')) {
356+
light[`${key}-rgb`] = colorHexToRgb(light[key]);
357+
}
358+
});
359+
Object.keys(dark).forEach((key) => {
360+
if (key.includes('surface-')) {
361+
dark[`${key}-rgb`] = colorHexToRgb(dark[key]);
362+
}
363+
});
354364
return {
355365
ios: {
356366
'--f7-theme-color': 'var(--f7-ios-primary)',

0 commit comments

Comments
 (0)