Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(contacts): implement single column layout #3315

Merged
merged 1 commit into from
Apr 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 52 additions & 72 deletions css/Properties/Properties.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* @copyright Copyright (c) 2018 John Molakvoæ <[email protected]>
*
* @author John Molakvoæ <[email protected]>
* @author Richard Steinmetz <[email protected]>
*
* @license GNU AGPL version 3 or any later version
*
Expand All @@ -19,47 +20,62 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
$property-label-min-width: 60px;
$property-label-max-width: 2 * $property-label-min-width;
$property-value-max-width: 250px;

$property-label-min-width: 100px;
$property-label-max-width: 200px;
$property-label-width: calc(($property-label-min-width + $property-label-max-width) / 2);

$property-value-min-width: 200px;
$property-value-max-width: 300px;
$property-value-width: calc(($property-value-min-width + $property-value-max-width) / 2);

$property-ext-padding-right: 8px;
$property-row-gap: 15px;

.property {
position: relative;
width: 100%;
// we need this to keep the alignment of the ext and delete/action button
// The flex grow will never go over those values. Therefore we can set
// the max width and keep the right alignment
max-width: $property-label-max-width + $property-value-max-width + 44px;

justify-self: center;

&--last {
margin-bottom: $grid-height-unit;
}
// no delete/action icon on addressbook selector
&--addressbooks &__actions {
display: none !important;
}
// property title row
&--title {
display: flex;
align-items: center;
gap: $property-row-gap;

&--without-actions {
padding-right: 44px; // actions menu / button
.property__actions {
// placeholder for the actions menu
&__empty {
width: 44px;
}
}
}

// property row
&__row {
position: relative;
display: flex;
align-items: center;
gap: $property-row-gap;

&--without-actions {
.property__value {
margin-right: $property-row-gap + 44px; // actions menu / button
}
}

// fix default margin from server stylesheet causing slight misalignment
input {
margin-right: 0;
}
}

// property label or multiselect within row
&__label,
&__label.multiselect {
flex: 1 0; // min width is 60px, let's grow until 120px
width: $property-label-min-width;
min-width: $property-label-min-width !important; // override multiselect
max-width: $property-label-max-width;
&__label {
display: flex;
justify-content: end;
flex: 1 auto;

width: $property-label-width !important;
min-width: $property-label-min-width !important;
max-width: $property-label-max-width !important;

&:not(.multiselect) {
overflow: hidden;
Expand All @@ -68,35 +84,6 @@ $property-ext-padding-right: 8px;
text-overflow: ellipsis;
opacity: .7;
}

// mouse feedback
.multiselect__tags {
opacity: .7;
}
&:hover,
&:focus,
&:active {
.multiselect__tags {
opacity: 1;
border-color: var(--color-border-dark);
}
}

// read-only mode
&.multiselect--disabled {
&, .multiselect__single {
&, &:hover, &:focus &:active {
border-color: transparent !important;
background-color: var(--color-main-background) !important;
}
}
}
}

&__label.multiselect {
.multiselect__tags {
border: none !important; // override multiselect
}
}

// Hide delete buttons initially
Expand All @@ -106,7 +93,12 @@ $property-ext-padding-right: 8px;

// Property value within row, after label
&__value {
flex: 1 1;
flex: 1 auto;

width: $property-value-width !important;
//min-width: $property-value-min-width !important;
min-width: unset !important;
max-width: $property-value-max-width !important;

textarea {
align-self: flex-start;
Expand All @@ -123,21 +115,19 @@ $property-ext-padding-right: 8px;
padding-right: 24px;
}

// Show ext and delete icon permanently on focus
// Show ext icon permanently on focus
&:hover,
&:focus,
&:active {
~ .property__ext,
~ .action-item.icon-delete {
~ .property__ext {
opacity: .5;
}
}
}

// Show ext and delete buttons on full row hover
// Show ext buttons on full row hover
&:hover {
.property__ext,
.action-item {
.property__ext {
opacity: .5;
}
}
Expand All @@ -162,15 +152,5 @@ $property-ext-padding-right: 8px;
// Delete property button + actions
&__actions {
z-index: 10;
margin-left: auto !important;
// floating actions next to the title
&--floating {
position: absolute !important;
right: 0;
bottom: 0;
}
}
.property__value {
margin-right: 0;
}
}
36 changes: 0 additions & 36 deletions css/Properties/PropertyTitle.scss

This file was deleted.

5 changes: 3 additions & 2 deletions css/contacts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*
* @author John Molakvoæ <[email protected]>
* @author Team Popcorn <[email protected]>
* @author Richard Steinmetz <[email protected]>
*
* @license GNU AGPL version 3 or any later version
*
Expand Down Expand Up @@ -32,7 +33,6 @@ $grid-input-height-with-margin: $grid-height-unit - $grid-input-margin * 2;
@import 'Settings/SettingsAddressbookSharee';
@import 'ContactsListItem';
@import 'Properties/Properties';
@import 'Properties/PropertyTitle';
@import 'ImportScreen';

// various
Expand All @@ -41,7 +41,8 @@ $grid-input-height-with-margin: $grid-height-unit - $grid-input-margin * 2;


.app-content-details {
padding: 0 44px 80px 44px;
padding: calc(var(--default-grid-baseline) * 2);
padding-top: 0;
height: 100%;
overflow: auto;
}
Expand Down
Loading