Skip to content

Commit

Permalink
Add mixins, auto import
Browse files Browse the repository at this point in the history
* add SASS mixins file
* add first mixin for language-dependent colons spacing
* auto import variables and mixins in files
  • Loading branch information
Bruno Besson committed Mar 9, 2021
1 parent b859e10 commit 13115d3
Show file tree
Hide file tree
Showing 49 changed files with 30 additions and 103 deletions.
2 changes: 0 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ export default {
</script>

<style lang="scss">
@import '@/assets/sass/variables.scss';
$sidemenu-width: 200px;
$body-height: calc(100vh - #{$navbar-height});
Expand Down
1 change: 1 addition & 0 deletions src/assets/sass/main.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import './variables.scss';
@import './mixins.scss';
@import './scrollbar.scss';
@import './external-links.scss';

Expand Down
14 changes: 14 additions & 0 deletions src/assets/sass/mixins.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@mixin colon {
:lang(fr) &:after {
content: '\00a0:';
}
:lang(it) &:after,
:lang(de) &:after,
:lang(en) &:after,
:lang(es) &:after,
:lang(ca) &:after,
:lang(eu) &:after,
:lang(zh) &:after {
content: ':';
}
}
2 changes: 0 additions & 2 deletions src/components/association-editor/AssociationItems.vue
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,6 @@ export default {
</script>
<style scoped lang="scss">
@import '@/assets/sass/variables.scss';
.association-items {
margin-bottom: 1rem;
Expand Down
2 changes: 0 additions & 2 deletions src/components/cards/DocumentCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ export default {
</script>

<style scoped lang="scss">
@import '@/assets/sass/variables.scss';
.document-card-container {
position: relative;
Expand Down
2 changes: 0 additions & 2 deletions src/components/cards/FeedCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,6 @@ export default {
</script>

<style scoped lang="scss">
@import '@/assets/sass/variables.scss';
@media screen and (max-width: $tablet) {
.feed-card {
border-left: 0 !important;
Expand Down
2 changes: 0 additions & 2 deletions src/components/cards/utils/CardContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ export default {
</script>

<style scoped lang="scss">
@import '@/assets/sass/variables.scss';
.card {
transition: 0.1s;
border: $card-border;
Expand Down
2 changes: 0 additions & 2 deletions src/components/cards/utils/CardRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
</template>

<style scoped lang="scss">
@import '@/assets/sass/variables.scss';
div {
padding: 0.4rem 0.8rem;
font-size: 0.9rem;
Expand Down
2 changes: 0 additions & 2 deletions src/components/cards/utils/CardTitle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
</template>

<style scoped lang="scss">
@import '@/assets/sass/variables.scss';
.card-header-title {
padding: 0.4rem 0.8rem;
display: block;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ export default Vue.extend({});
</script>

<style lang="scss" scoped>
@import '@/assets/sass/variables.scss';
.cell-activities {
font-size: 26px;
}
Expand Down
2 changes: 0 additions & 2 deletions src/components/gdpr/GdprBanner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ export default {
</script>

<style lang="scss" scoped>
@import '@/assets/sass/variables.scss';
.gdpr-content {
z-index: 30;
position: fixed;
Expand Down
2 changes: 0 additions & 2 deletions src/components/generics/Activities.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ export default {
</script>

<style scoped lang="scss">
@import '@/assets/sass/variables.scss';
@media print {
/*write the activity's title instead of the icon*/
.replace-icon-by-names-on-print {
Expand Down
2 changes: 0 additions & 2 deletions src/components/generics/ContentBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ export default {
</script>

<style scoped lang="scss">
@import '@/assets/sass/variables.scss';
//default
$cb-shadow: 0;
$cb-border-top: 0;
Expand Down
2 changes: 0 additions & 2 deletions src/components/generics/Markdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,6 @@ export default {

<style lang="scss">
// Not scoped syle, because CSS selector are not explicitly present in template
@import '@/assets/sass/variables.scss';
.markdown-content:not(:last-child) {
margin-bottom: 1.5rem;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/generics/icons/IconCondition.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default {
};
</script>

<style scoped>
<style scoped lang="scss">
.icon-condition-excellent {
color: green;
}
Expand Down
2 changes: 0 additions & 2 deletions src/components/generics/inputs/InputActivity.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ export default {
</script>

<style scoped lang="scss">
@import '@/assets/sass/variables.scss';
.input-item {
font-size: 40px;
margin: 4px;
Expand Down
2 changes: 0 additions & 2 deletions src/components/generics/inputs/InputEventActivity.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ export default {
</script>

<style scoped lang="scss">
@import '@/assets/sass/variables.scss';
.input-item {
font-size: 40px;
margin: 4px;
Expand Down
2 changes: 0 additions & 2 deletions src/components/generics/inputs/InputMultiSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ export default {
</script>

<style scoped lang="scss">
@import '@/assets/sass/variables.scss';
.has-error {
box-shadow: 0px 0px 8px 0px $danger;
// border: 1px solid $danger;
Expand Down
2 changes: 0 additions & 2 deletions src/components/generics/inputs/InputOrientation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ export default {
</script>

<style scoped lang="scss">
@import '@/assets/sass/variables.scss';
.input-orientation > g > path {
fill: #ddd;
transition: 0.1s;
Expand Down
2 changes: 0 additions & 2 deletions src/components/generics/inputs/InputSimple.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ export default {
</script>

<style scoped lang="scss">
@import '@/assets/sass/variables.scss';
select,
input {
min-width: 15rem;
Expand Down
2 changes: 0 additions & 2 deletions src/components/image-viewer/ImageViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,6 @@ export default {
</style>

<style scoped lang="scss">
@import '@/assets/sass/variables.scss';
$headerHeight: 3rem;
$paginationHeight: 30px;
Expand Down
4 changes: 0 additions & 4 deletions src/views/Navigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,6 @@ export default {
</script>

<style scoped lang="scss">
@import '@/assets/sass/variables.scss';
nav {
max-width: 100vw;
height: $navbar-height;
Expand Down Expand Up @@ -376,8 +374,6 @@ nav {
</style>

<style lang="scss">
@import '@/assets/sass/variables.scss';
@media screen and (max-width: $tablet) {
.add-button .dropdown-content {
position: fixed;
Expand Down
2 changes: 0 additions & 2 deletions src/views/SideMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ export default {
</script>

<style scoped lang="scss">
@import '@/assets/sass/variables.scss';
$brandLogoHeight: 70px;
$brandLogoMargin: 5px;
Expand Down
2 changes: 0 additions & 2 deletions src/views/document/utils/DocumentViewHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ export default {
</script>

<style scoped lang="scss">
@import '@/assets/sass/variables.scss';
.button-bar {
font-size: 1.5rem;
}
Expand Down
2 changes: 0 additions & 2 deletions src/views/document/utils/FollowButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ export default {
</script>

<style scoped lang="scss">
@import '@/assets/sass/variables.scss';
.follow-button-yellow {
color: $yellow !important;
}
Expand Down
2 changes: 0 additions & 2 deletions src/views/document/utils/TagsButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ export default {
</script>

<style scoped lang="scss">
@import '@/assets/sass/variables.scss';
.todo-button.active {
color: $yellow !important;
}
Expand Down
2 changes: 0 additions & 2 deletions src/views/document/utils/boxes/AssociatedDocuments.vue
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,6 @@ export default {
</script>
<style scoped lang="scss">
@import '@/assets/sass/variables.scss';
.title {
margin-bottom: 0.2rem !important;
}
Expand Down
2 changes: 0 additions & 2 deletions src/views/document/utils/boxes/CommentsBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,6 @@ export default {
</script>

<style lang="scss">
@import '@/assets/sass/variables.scss';
.discourse-post {
border-top: 6px solid $color-base-c2c;
margin-bottom: 1.5rem;
Expand Down
2 changes: 0 additions & 2 deletions src/views/document/utils/boxes/ToolBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,6 @@ export default {
</script>
<style scoped lang="scss">
@import '@/assets/sass/variables.scss';
.toolbox-button {
cursor: pointer;
Expand Down
2 changes: 0 additions & 2 deletions src/views/document/utils/boxes/ToolBoxButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ export default {
</script>

<style scoped lang="scss">
@import '@/assets/sass/variables.scss';
.toolbox-button {
display: block;
cursor: pointer;
Expand Down
2 changes: 0 additions & 2 deletions src/views/document/utils/field-viewers/ConditionLevels.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ export default {
</script>

<style lang="scss" scoped>
@import '@/assets/sass/variables.scss';
@media screen and (max-width: $tablet) {
thead {
display: none;
Expand Down
15 changes: 3 additions & 12 deletions src/views/document/utils/field-viewers/LabelValue.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,8 @@ export default {
};
</script>

<style scoped>
:lang(fr) .label-value-label:after {
content: '\00a0:';
}
:lang(it) .label-value-label:after,
:lang(de) .label-value-label:after,
:lang(en) .label-value-label:after,
:lang(es) .label-value-label:after,
:lang(ca) .label-value-label:after,
:lang(eu) .label-value-label:after,
:lang(zh) .label-value-label:after {
content: ':';
<style scoped lang="scss">
.label-value-label {
@include colon;
}
</style>
2 changes: 0 additions & 2 deletions src/views/document/utils/windows/MergeDocumentWindow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ export default {
</script>

<style scoped lang="scss">
@import '@/assets/sass/variables.scss';
.modal-card-body,
.modal-card,
.modal {
Expand Down
2 changes: 0 additions & 2 deletions src/views/documents/DocumentsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,6 @@ export default {
</script>

<style scoped lang="scss">
@import '@/assets/sass/variables.scss';
$section-padding: 1.5rem; //TODO find this variable
$header-height: 34px;
$header-padding-bottom: 1.5rem; //TODO find this variable
Expand Down
2 changes: 0 additions & 2 deletions src/views/documents/utils/PageSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ export default {
</script>
<style scoped lang="scss">
@import '@/assets/sass/variables.scss';
.pagination-link {
height: 1.75em;
}
Expand Down
2 changes: 0 additions & 2 deletions src/views/documents/utils/QueryItems.vue
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,6 @@ export default {
</script>
<style scoped lang="scss">
@import '@/assets/sass/variables.scss';
.title-input {
display: inline-flex;
margin-bottom: 0 !important;
Expand Down
2 changes: 0 additions & 2 deletions src/views/portals/FeedView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ export default {
</script>

<style scoped lang="scss">
@import '@/assets/sass/variables.scss';
@media screen and (max-width: $tablet) {
.feed-view {
padding-left: 0;
Expand Down
2 changes: 0 additions & 2 deletions src/views/portals/HomeBanner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ export default {
</script>

<style scoped lang="scss">
@import '@/assets/sass/variables.scss';
section {
background-image: url('~@/assets/img/backgrounds/alexbuisse-greenland-800w.jpg');
background-size: cover;
Expand Down
2 changes: 0 additions & 2 deletions src/views/portals/YetiView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1024,8 +1024,6 @@ export default {
</script>

<style scoped lang="scss">
@import '@/assets/sass/variables.scss';
$section-padding: 1.5rem; //TODO find this variable
$box-padding: 1.25rem; //TODO find this variable
$header-height: 34px;
Expand Down
2 changes: 0 additions & 2 deletions src/views/portals/utils/DashboardLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ export default {
</script>

<style scoped lang="scss">
@import '@/assets/sass/variables.scss';
.dashboard-link {
.activity-icons {
line-height: 1;
Expand Down
2 changes: 0 additions & 2 deletions src/views/portals/utils/ForumWidget.vue
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,6 @@ export default {
</script>

<style scoped lang="scss">
@import '@/assets/sass/variables.scss';
.forum-row {
display: flex;
color: $text;
Expand Down
Loading

0 comments on commit 13115d3

Please sign in to comment.