Skip to content

Commit

Permalink
pkp/pkp-lib#3594 Style option form fields
Browse files Browse the repository at this point in the history
  • Loading branch information
NateWr committed May 30, 2018
1 parent 2a025c1 commit a2e9390
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/components/Form/fields/FieldBase.vue
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ export default {
.pkpFormField__description {
font-size: @font-sml;
line-height: 1.8em;
}
// Should be used for any text input and select fields to ensure consistency
Expand Down
37 changes: 34 additions & 3 deletions src/components/Form/fields/FieldOptions.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<fieldset class="pkpFormField pkpFormField--options" :class="classes">
<legend>
<legend class="pkpFormField--options__legend">
{{ maybeLocalize(label, localeKey) }}
<span v-if="isRequired" class="pkpFormFieldLabel__required">
*
Expand All @@ -11,12 +11,12 @@
<help-button v-if="helpTopic" :id="describedByHelpId" :topic="helpTopic" :label="i18n.help" />
</legend>
<div v-if="description"
class="pkpFormField__description"
class="pkpFormField__description pkpFormField--options__description"
v-html="maybeLocalize(description, localeKey)"
:id="describedByDescriptionId"
/>
<div class="pkpFormField__control">
<label v-for="option in localizedOptions">
<label v-for="option in localizedOptions" class="pkpFormField--options__option">
<input
class="pkpFormField--options__input"
v-model="selectedValue"
Expand Down Expand Up @@ -106,4 +106,35 @@ export default {
<style lang="less">
@import '../../../styles/_import';
.pkpFormField--options {
border: @bg-border;
}
.pkpFormField--options__legend {
padding: 0 @half;
}
.pkpFormField--options__description {
margin-bottom: @base;
}
.pkpFormField--options__option {
position: relative;
display: block;
padding-left: @base + @half;
font-size: @font-sml;
line-height: 1.8em;
cursor: pointer;
+ .pkpFormField--options__option {
margin-top: @half;
}
}
.pkpFormField--options__input {
position: absolute;
top: .9em;
left: 0;
transform: translateY(-50%);
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export default {
name: 'user-locales',
component: 'field-options',
label: 'Working Languages',
description: 'Disable language options that you can not use.',
description: 'We use this to adjust your email notifications and the information we request from you.',
value: [],
options: [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default {
id: 'preferences',
label: 'Preferences',
description: 'Tailor how you would like interact with our journal.',
description: 'Tailor how you would like to interact with our journal.',
};

0 comments on commit a2e9390

Please sign in to comment.