Skip to content

Commit

Permalink
feat: remove link highlights in MD theme, use only touch ripple
Browse files Browse the repository at this point in the history
  • Loading branch information
nolimits4web committed Mar 31, 2023
1 parent 0d00807 commit e96f363
Show file tree
Hide file tree
Showing 20 changed files with 51 additions and 35 deletions.
3 changes: 3 additions & 0 deletions src/core/components/button/button-ios.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// Buttons
.button {
transition-duration: 100ms;
&.active-state {
background-color: var(--f7-button-pressed-bg-color, rgba(var(--f7-theme-color-rgb), 0.15));
}
}
.button-fill,
.button-fill-ios {
Expand Down
5 changes: 1 addition & 4 deletions src/core/components/button/button-md.less
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
}
.button-fill,
.button-fill-md {
--f7-button-pressed-bg-color: var(
--f7-button-fill-pressed-bg-color,
var(--f7-theme-color-shade)
);
--f7-button-pressed-bg-color: var(--f7-button-fill-pressed-bg-color, transparent);
}
}
15 changes: 10 additions & 5 deletions src/core/components/button/button-vars.less
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

/*
--f7-button-text-color: var(--f7-theme-color);
--f7-button-pressed-bg-color: rgba(var(--f7-theme-color-rgb), .15);
--f7-button-pressed-text-color: var(--f7-button-text-color, var(--f7-theme-color));
--f7-button-border-color: var(--f7-theme-color);
--f7-button-fill-bg-color: var(--f7-theme-color);
Expand All @@ -23,13 +22,11 @@
--f7-segmented-strong-button-active-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.25);
.light-vars({
--f7-segmented-strong-button-text-color: #000;
--f7-segmented-strong-button-pressed-bg-color: rgba(0,0,0,0.07);
--f7-segmented-strong-button-hover-bg-color: rgba(0,0,0,0.04);
--f7-segmented-strong-button-active-text-color: #000;
--f7-segmented-strong-button-active-bg-color: #fff;
});
.dark-vars({
--f7-segmented-strong-button-pressed-bg-color: rgba(255,255,255,0.04);
--f7-segmented-strong-button-hover-bg-color: rgba(255,255,255,0.02);
--f7-segmented-strong-button-active-bg-color: rgba(255, 255, 255, 0.14);
--f7-segmented-strong-button-text-color: #fff;
Expand All @@ -47,6 +44,7 @@
--f7-button-outline-border-color: var(--f7-theme-color);
--f7-button-outline-border-width: 2px;
/*
--f7-button-pressed-bg-color: rgba(var(--f7-theme-color-rgb), .15);
--f7-button-fill-pressed-bg-color: var(--f7-theme-color-tint);
*/
--f7-button-large-text-transform: uppercase;
Expand All @@ -68,14 +66,19 @@

.light-vars({
--f7-segmented-strong-bg-color: rgba(0,0,0,0.07);
--f7-segmented-strong-button-pressed-bg-color: rgba(0,0,0,0.07);
});

.dark-vars({
--f7-segmented-strong-bg-color: rgba(255, 255, 255, 0.1);
--f7-segmented-strong-button-pressed-bg-color: rgba(255,255,255,0.04);
});

});
.md-vars({
/*
--f7-button-pressed-bg-color: transparent;
*/
--f7-button-text-transform: none;
--f7-button-height: 40px;
--f7-button-padding-horizontal: 16px;
Expand All @@ -94,14 +97,16 @@
--f7-button-small-font-weight: 500;
--f7-segmented-strong-button-text-transform: none;
--f7-segmented-strong-button-active-font-weight: 500;
--f7-segmented-strong-button-pressed-bg-color: transparent;

});

.md-color-vars({
--f7-button-fill-pressed-bg-color: var(--f7-theme-color-shade);
--f7-button-fill-pressed-bg-color: transparent;
--f7-button-fill-text-color: var(--f7-md-on-primary);
--f7-button-outline-border-color: var(--f7-md-outline);
--f7-segmented-strong-bg-color: var(--f7-md-surface-variant);
--f7-button-tonal-bg-color: var(--f7-md-secondary-container);
--f7-button-tonal-pressed-bg-color: rgba(var(--f7-theme-color-rgb), 0.25);
--f7-button-tonal-pressed-bg-color: transparent;
--f7-button-tonal-text-color: var(--f7-md-on-secondary-container);
});
1 change: 0 additions & 1 deletion src/core/components/button/button.less
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ button {
background-color: var(--f7-button-bg-color);
box-shadow: var(--f7-button-box-shadow);
&.active-state {
background-color: var(--f7-button-pressed-bg-color, rgba(var(--f7-theme-color-rgb), 0.15));
color: var(--f7-button-pressed-text-color, var(--f7-button-text-color, var(--f7-theme-color)));
}
input[type='submit']&,
Expand Down
1 change: 0 additions & 1 deletion src/core/components/data-table/data-table-md.less
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
a.link {
width: 48px;
height: 48px;
.link-highlight();
}
}
.data-table-rows-select {
Expand Down
4 changes: 2 additions & 2 deletions src/core/components/dialog/dialog-vars.less
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@
});

.md-color-vars({
--f7-dialog-button-pressed-bg-color: rgba(var(--f7-theme-color-rgb), 0.15);
--f7-dialog-button-pressed-bg-color: transparent;
--f7-dialog-button-strong-bg-color: var(--f7-theme-color);
--f7-dialog-button-strong-text-color: var(--f7-md-on-primary);
--f7-dialog-button-strong-pressed-bg-color: var(--f7-theme-color-shade);
--f7-dialog-button-strong-pressed-bg-color: transparent;
--f7-dialog-bg-color: var(--f7-md-surface-3);
--f7-dialog-text-color: var(--f7-md-on-surface-variant);
--f7-dialog-title-text-color: var(--f7-md-on-surface);
Expand Down
1 change: 1 addition & 0 deletions src/core/components/fab/fab-ios.less
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.fab-buttons a {
&.active-state {
transition-duration: 0ms;
background-color: var(--f7-fab-pressed-bg-color, var(--f7-theme-color-shade));
}
}
}
9 changes: 9 additions & 0 deletions src/core/components/fab/fab-md.less
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
.md {
.fab > a,
.fab-buttons a {
&.active-state {
background-color: var(
--f7-fab-pressed-bg-color,
var(--f7-fab-bg-color, var(--f7-theme-color))
);
}
}
}
6 changes: 5 additions & 1 deletion src/core/components/fab/fab-vars.less
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
--f7-fab-label-padding: 4px 12px;
--f7-fab-label-font-size: inherit;
--f7-fab-button-size: 40px;
/* --f7-fab-pressed-bg-color: var(--f7-theme-color-shade); */
/* --f7-fab-bg-color: var(--f7-theme-color)); */
}
.ios-vars({
/* --f7-fab-pressed-bg-color: var(--f7-theme-color-shade); */
--f7-fab-text-color: #fff;
--f7-fab-border-radius: 50px;
--f7-fab-size: 50px;
Expand All @@ -22,6 +23,9 @@
--f7-fab-label-bg-color: #fff;
});
.md-vars({
/*
--f7-fab-pressed-bg-color: var(--f7-fab-bg-color, var(--f7-theme-color));
*/
--f7-fab-border-radius: 16px;
--f7-fab-size: 56px;
--f7-fab-box-shadow: 0px 3px 5px -1px rgba(0, 0, 0, 0.2),
Expand Down
3 changes: 0 additions & 3 deletions src/core/components/fab/fab.less
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,6 @@
overflow: hidden;
z-index: 1;
color: var(--f7-fab-text-color);
&.active-state {
background-color: var(--f7-fab-pressed-bg-color, var(--f7-theme-color-shade));
}
}

.fab > a {
Expand Down
5 changes: 5 additions & 0 deletions src/core/components/list/list-md.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.md {
.menu-list .item-link.active-state {
background-color: var(--f7-menu-list-item-bg-color);
}
}
14 changes: 7 additions & 7 deletions src/core/components/list/list-vars.less
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

/*
--f7-list-button-text-color: var(--f7-theme-color);
--f7-list-button-pressed-bg-color: rgba(var(--f7-theme-color-rgb), .15);
*/
--f7-list-button-font-size: inherit;
--f7-list-button-font-weight: 400;
Expand Down Expand Up @@ -82,6 +81,9 @@
--f7-list-media-item-padding-vertical: 10px;
--f7-list-media-item-title-font-weight: 600;
--f7-list-button-border-color: rgba(0,0,0,0.22);
/*
--f7-list-button-pressed-bg-color: rgba(var(--f7-theme-color-rgb), .15);
*/

--f7-list-group-title-border-color: rgba(0,0,0,0.22);

Expand Down Expand Up @@ -146,6 +148,9 @@
--f7-list-media-item-padding-vertical: 12px;
--f7-list-media-item-title-font-weight: 500;
--f7-list-button-border-color: transparent;
/*
--f7-list-button-pressed-bg-color: transparent;
*/

--f7-list-group-title-border-color: transparent;

Expand All @@ -156,13 +161,8 @@
--f7-menu-list-offset: 16px;
--f7-menu-list-border-radius: 999px;
--f7-menu-list-item-min-height: 56px;
--f7-list-link-pressed-bg-color: transparent;

.light-vars({
--f7-list-link-pressed-bg-color: rgba(0,0,0,0.1);
});
.dark-vars({
--f7-list-link-pressed-bg-color: rgba(255,255,255,0.05);
});
});

.md-color-vars({
Expand Down
5 changes: 4 additions & 1 deletion src/core/components/list/list.less
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,12 @@
font-weight: var(--f7-list-button-font-weight);
text-align: var(--f7-list-button-text-align);

&.active-state {
.ios &.active-state {
background-color: var(--f7-list-button-pressed-bg-color, rgba(var(--f7-theme-color-rgb), 0.15));
}
.md &.active-state {
background-color: var(--f7-list-button-pressed-bg-color, transparent);
}
.list-dividers &,
.ios .list-dividers-ios &,
.md .list-dividers-md & {
Expand Down
1 change: 0 additions & 1 deletion src/core/components/navbar/navbar-md.less
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
a.link {
padding: 0 12px;
min-width: 48px;
.link-highlight();
}
a.icon-only {
min-width: 0;
Expand Down
3 changes: 0 additions & 3 deletions src/core/components/searchbar/searchbar-md.less
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@
right: calc(var(--f7-searchbar-inner-padding-right) + var(--f7-safe-area-right));
});

.link-highlight();

&:after {
.core-icons-font();
line-height: 48px;
Expand Down Expand Up @@ -74,7 +72,6 @@
margin-top: -24px;
.ltr({ right: 0; });
.rtl({ left: 0; });
.link-highlight();

&:after {
line-height: 48px;
Expand Down
4 changes: 2 additions & 2 deletions src/core/components/stepper/stepper-md.less
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
.stepper-fill,
.stepper-fill-md {
--f7-stepper-button-pressed-bg-color: var(
--f7-stepper-fill-button-pressed-bg-color,
var(--f7-theme-color-shade)
--f7-stepper-fill-button-bg-color,
var(--f7-theme-color)
);
}
}
3 changes: 2 additions & 1 deletion src/core/components/stepper/stepper-vars.less
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@
--f7-stepper-value-font-size: 14px;
--f7-stepper-border-width: 1px;
--f7-stepper-small-border-width: 1px;
--f7-stepper-button-pressed-bg-color: transparent;
});
.md-color-vars({
--f7-stepper-fill-button-text-color: var(--f7-md-on-primary);
--f7-stepper-fill-button-pressed-bg-color: var(--f7-theme-color-shade);
--f7-stepper-fill-button-pressed-bg-color: var(--f7-theme-color);
--f7-stepper-border-color: var(--f7-md-outline);
});
1 change: 0 additions & 1 deletion src/core/components/subnavbar/subnavbar-md.less
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
}
});;
a.link {
.link-highlight();
justify-content: center;
padding: 0 12px;
}
Expand Down
1 change: 0 additions & 1 deletion src/core/components/text-editor/text-editor-md.less
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.md {
button.text-editor-button {
--f7-touch-ripple-color: rgba(var(--f7-theme-color-rgb), 0.25);
.link-highlight();
}
.text-editor-keyboard-toolbar {
.toolbar-inner {
Expand Down
1 change: 0 additions & 1 deletion src/core/components/toolbar/toolbar-md.less
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
justify-content: center;
padding: 0 12px;
min-width: 48px;
.link-highlight();
}
a.icon-only {
min-width: 0;
Expand Down

0 comments on commit e96f363

Please sign in to comment.