diff --git a/.stylelintrc.js b/.stylelintrc.js
index 97e1ec8023..f028c76cc0 100644
--- a/.stylelintrc.js
+++ b/.stylelintrc.js
@@ -15,6 +15,9 @@ module.exports = {
"number-leading-zero": null,
"selector-list-comma-newline-after": null,
"at-rule-no-unknown": null,
- "scss/at-rule-no-unknown": true,
+ "scss/at-rule-no-unknown": [true, {
+ // https://github.com/vector-im/riot-web/issues/10544
+ "ignoreAtRules": ["define-mixin"],
+ }],
}
}
diff --git a/res/css/_common.scss b/res/css/_common.scss
index 517ced43fb..1b7c8ec938 100644
--- a/res/css/_common.scss
+++ b/res/css/_common.scss
@@ -559,3 +559,7 @@ input[type=text]:focus, input[type=password]:focus, textarea:focus {
.mx_Username_color8 {
color: $username-variant8-color;
}
+
+@define-mixin mx_Settings_fullWidthField {
+ margin-right: 200px;
+}
diff --git a/res/css/_components.scss b/res/css/_components.scss
index dff174e943..abfce47916 100644
--- a/res/css/_components.scss
+++ b/res/css/_components.scss
@@ -168,6 +168,7 @@
@import "./views/settings/_Notifications.scss";
@import "./views/settings/_PhoneNumbers.scss";
@import "./views/settings/_ProfileSettings.scss";
+@import "./views/settings/_SetIdServer.scss";
@import "./views/settings/tabs/_SettingsTab.scss";
@import "./views/settings/tabs/room/_GeneralRoomSettingsTab.scss";
@import "./views/settings/tabs/room/_RolesRoomSettingsTab.scss";
diff --git a/res/css/views/elements/_Tooltip.scss b/res/css/views/elements/_Tooltip.scss
index 8f6204c942..cc4eb409df 100644
--- a/res/css/views/elements/_Tooltip.scss
+++ b/res/css/views/elements/_Tooltip.scss
@@ -55,7 +55,7 @@ limitations under the License.
border-radius: 4px;
box-shadow: 4px 4px 12px 0 $menu-box-shadow-color;
background-color: $menu-bg-color;
- z-index: 2000;
+ z-index: 4000; // Higher than dialogs so tooltips can be used in dialogs
padding: 10px;
pointer-events: none;
line-height: 14px;
diff --git a/res/css/views/settings/_ProfileSettings.scss b/res/css/views/settings/_ProfileSettings.scss
index 3e97a0ff6d..afac75986f 100644
--- a/res/css/views/settings/_ProfileSettings.scss
+++ b/res/css/views/settings/_ProfileSettings.scss
@@ -26,6 +26,10 @@ limitations under the License.
height: 4em;
}
+.mx_ProfileSettings_controls .mx_Field {
+ margin-right: 100px;
+}
+
.mx_ProfileSettings_controls .mx_Field:first-child {
margin-top: 0;
}
diff --git a/res/css/views/settings/_SetIdServer.scss b/res/css/views/settings/_SetIdServer.scss
new file mode 100644
index 0000000000..55ad6eef02
--- /dev/null
+++ b/res/css/views/settings/_SetIdServer.scss
@@ -0,0 +1,19 @@
+/*
+Copyright 2019 The Matrix.org Foundation C.I.C.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+.mx_SetIdServer .mx_Field_input {
+ @mixin mx_Settings_fullWidthField;
+}
diff --git a/res/css/views/settings/tabs/user/_GeneralUserSettingsTab.scss b/res/css/views/settings/tabs/user/_GeneralUserSettingsTab.scss
index 3b330f2c30..16467165cf 100644
--- a/res/css/views/settings/tabs/user/_GeneralUserSettingsTab.scss
+++ b/res/css/views/settings/tabs/user/_GeneralUserSettingsTab.scss
@@ -16,7 +16,7 @@ limitations under the License.
.mx_GeneralUserSettingsTab_changePassword .mx_Field,
.mx_GeneralUserSettingsTab_themeSection .mx_Field {
- margin-right: 100px; // Align with the other fields on the page
+ @mixin mx_Settings_fullWidthField;
}
.mx_GeneralUserSettingsTab_changePassword .mx_Field:first-child {
@@ -26,5 +26,5 @@ limitations under the License.
.mx_GeneralUserSettingsTab_accountSection .mx_EmailAddresses,
.mx_GeneralUserSettingsTab_accountSection .mx_PhoneNumbers,
.mx_GeneralUserSettingsTab_languageInput {
- margin-right: 100px; // Align with the other fields on the page
+ @mixin mx_Settings_fullWidthField;
}
diff --git a/res/css/views/settings/tabs/user/_PreferencesUserSettingsTab.scss b/res/css/views/settings/tabs/user/_PreferencesUserSettingsTab.scss
index b3430f47af..d003e175d9 100644
--- a/res/css/views/settings/tabs/user/_PreferencesUserSettingsTab.scss
+++ b/res/css/views/settings/tabs/user/_PreferencesUserSettingsTab.scss
@@ -15,5 +15,5 @@ limitations under the License.
*/
.mx_PreferencesUserSettingsTab .mx_Field {
- margin-right: 100px; // Align with the rest of the controls
+ @mixin mx_Settings_fullWidthField;
}
diff --git a/res/css/views/settings/tabs/user/_VoiceUserSettingsTab.scss b/res/css/views/settings/tabs/user/_VoiceUserSettingsTab.scss
index 36c8cfd896..69d57bdba1 100644
--- a/res/css/views/settings/tabs/user/_VoiceUserSettingsTab.scss
+++ b/res/css/views/settings/tabs/user/_VoiceUserSettingsTab.scss
@@ -15,7 +15,7 @@ limitations under the License.
*/
.mx_VoiceUserSettingsTab .mx_Field {
- margin-right: 100px; // align with the rest of the fields
+ @mixin mx_Settings_fullWidthField;
}
.mx_VoiceUserSettingsTab_missingMediaPermissions {
diff --git a/src/components/views/elements/Field.js b/src/components/views/elements/Field.js
index e920bdb0fd..8272b36639 100644
--- a/src/components/views/elements/Field.js
+++ b/src/components/views/elements/Field.js
@@ -46,6 +46,9 @@ export default class Field extends React.PureComponent {
// and a `feedback` react component field to provide feedback
// to the user.
onValidate: PropTypes.func,
+ // If specified, contents will appear as a tooltip on the element and
+ // validation feedback tooltips will be suppressed.
+ tooltipContent: PropTypes.node,
// All other props pass through to the .
};
@@ -134,7 +137,7 @@ export default class Field extends React.PureComponent {
}, VALIDATION_THROTTLE_MS);
render() {
- const { element, prefix, onValidate, children, ...inputProps } = this.props;
+ const { element, prefix, onValidate, children, tooltipContent, ...inputProps } = this.props;
const inputElement = element || "input";
@@ -165,12 +168,12 @@ export default class Field extends React.PureComponent {
// Handle displaying feedback on validity
const Tooltip = sdk.getComponent("elements.Tooltip");
- let tooltip;
- if (this.state.feedback) {
- tooltip =