Skip to content

Commit

Permalink
enhancement: add global class .vue-form-generator. Rewriting of mos…
Browse files Browse the repository at this point in the history
…t selector for a more encapsulated style.
  • Loading branch information
Lionel Bijaoui committed Aug 9, 2016
1 parent 778a9ff commit e864d10
Show file tree
Hide file tree
Showing 19 changed files with 19 additions and 36 deletions.
2 changes: 1 addition & 1 deletion src/fields/fieldCheckbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</script>

<style lang="sass">
input[type=checkbox] {
.vue-form-generator .field-checkbox {
margin-left: 12px;
}
</style>
2 changes: 1 addition & 1 deletion src/fields/fieldColor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


<style lang="sass">
span {
.vue-form-generator .field-color .helper {
margin-left: 0.3em;
}
</style>
3 changes: 0 additions & 3 deletions src/fields/fieldDateTime.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,4 @@


<style lang="sass">
input {
width: 100%;
}
</style>
3 changes: 0 additions & 3 deletions src/fields/fieldEmail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,4 @@


<style lang="sass">
input {
width: 100%;
}
</style>
5 changes: 3 additions & 2 deletions src/fields/fieldImage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@
</script>

<style lang="sass">
.wrapper, input {
.vue-form-generator .field-image {
&.wrapper {
width: 100%;
}
.preview {
position: relative;
margin-top: 5px;
Expand Down Expand Up @@ -100,4 +100,5 @@
}
}
}
}
</style>
2 changes: 1 addition & 1 deletion src/fields/fieldLabel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</script>

<style lang="sass">
span {
.vue-form-generator .field-label {
display: block;
width: 100%;
margin-left: 12px;
Expand Down
3 changes: 0 additions & 3 deletions src/fields/fieldMasked.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,4 @@
</script>

<style lang="sass">
input {
width: 100%;
}
</style>
3 changes: 0 additions & 3 deletions src/fields/fieldNumber.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,4 @@


<style lang="sass">
input {
width: 100%;
}
</style>
3 changes: 0 additions & 3 deletions src/fields/fieldPassword.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,4 @@
</script>

<style lang="sass">
input {
width: 100%;
}
</style>
2 changes: 2 additions & 0 deletions src/fields/fieldRange.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@


<style lang="sass">
.vue-form-generator .field-range {
input {
width: 100%;
}
.helpText {
margin: auto 0.5em;
}
}
</style>
3 changes: 0 additions & 3 deletions src/fields/fieldSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,4 @@


<style lang="sass">
select {
width: 100%;
}
</style>
2 changes: 1 addition & 1 deletion src/fields/fieldSelectEx.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@


<style lang="sass">
.bootstrap-select {
.vue-form-generator .field-selectEx .bootstrap-select {
.dropdown-menu li.selected .text{
font-weight: bold;
}
Expand Down
2 changes: 1 addition & 1 deletion src/fields/fieldSlider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@


<style lang="sass">
.irs {
.vue-form-generator .field-slider .irs {
width: 100%;
}
</style>
2 changes: 1 addition & 1 deletion src/fields/fieldStaticMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</script>

<style lang="sass">
img {
.vue-form-generator .field-staticMap img {
display: block;
width: auto;
max-width: 100%;
Expand Down
2 changes: 1 addition & 1 deletion src/fields/fieldSubmit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</script>

<style lang="sass">
input {
.vue-form-generator .field-submit input {
width: 100%;
}
</style>
9 changes: 5 additions & 4 deletions src/fields/fieldSwitch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@

<style lang="sass">
$width: 120px;
$field-switch-width: 120px;
label {
.vue-form-generator .field-switch {
.field-wrap label {
position: relative;
display: block;
vertical-align: top;
width: $width;
width: $field-switch-width;
height: 30px;
padding: 3px;
margin: 0 10px 10px 0;
Expand Down Expand Up @@ -136,5 +137,5 @@
.label, .handle {
transition: all 0.3s ease;
}
}
</style>
2 changes: 1 addition & 1 deletion src/fields/fieldText.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</script>

<style lang="sass">
input {
.vue-form-generator .field-text input {
width: 100%;
}
</style>
3 changes: 0 additions & 3 deletions src/fields/fieldTextArea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,4 @@


<style lang="sass">
textarea {
width: 100%;
}
</style>
2 changes: 1 addition & 1 deletion src/formGenerator.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template lang="jade">
fieldset(v-if="schema != null")
fieldset.vue-form-generator(v-if="schema != null")
.form-group(v-for="field in fields", v-if="fieldVisible(field)", :class="getFieldRowClasses(field)")
label {{ field.label }}
span.help(v-if="field.help")
Expand Down

0 comments on commit e864d10

Please sign in to comment.