Skip to content

Commit

Permalink
Fixed #4235 - Divider: unstyled mode updates
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed Aug 3, 2023
1 parent 6a2af3f commit 0f07556
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 25 deletions.
33 changes: 9 additions & 24 deletions components/lib/divider/BaseDivider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,6 @@ const styles = `
content: '';
}
.p-divider-horizontal.p-divider-left {
justify-content: flex-start;
}
.p-divider-horizontal.p-divider-right {
justify-content: flex-end;
}
.p-divider-horizontal.p-divider-center {
justify-content: center;
}
.p-divider-content {
z-index: 1;
}
Expand All @@ -52,18 +40,6 @@ const styles = `
content: '';
}
.p-divider-vertical.p-divider-top {
align-items: flex-start;
}
.p-divider-vertical.p-divider-center {
align-items: center;
}
.p-divider-vertical.p-divider-bottom {
align-items: flex-end;
}
.p-divider-solid.p-divider-horizontal:before {
border-top-style: solid;
}
Expand All @@ -89,6 +65,14 @@ const styles = `
}
`;
/* Position */
const inlineStyles = {
root: ({ props }) => ({
justifyContent: props.layout === 'horizontal' ? (props.align == 'center' || props.align == null ? 'center' : props.align === 'left' ? 'flex-start' : props.align === 'right' ? 'flex-end' : null) : null,
alignItems: props.vertical === 'vertical' ? (props.align == 'center' || props.align == null ? 'center' : props.align === 'top' ? 'flex-start' : props.align === 'bottom' ? 'flex-end' : null) : null
})
};
const classes = {
root: ({ props }) => [
'p-divider p-component',
Expand Down Expand Up @@ -125,6 +109,7 @@ export default {
},
css: {
classes,
inlineStyles,
loadStyle
},
provide() {
Expand Down
2 changes: 1 addition & 1 deletion components/lib/divider/Divider.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div :class="cx('root')" role="separator" :aria-orientation="layout" v-bind="ptm('root')" data-pc-name="divider">
<div :class="cx('root')" :style="sx('root')" role="separator" :aria-orientation="layout" v-bind="ptm('root')" data-pc-name="divider">
<div v-if="$slots.default" :class="cx('content')" v-bind="ptm('content')">
<slot></slot>
</div>
Expand Down

0 comments on commit 0f07556

Please sign in to comment.