Skip to content

Commit

Permalink
fix(core/message-bar): fix styling (#1064)
Browse files Browse the repository at this point in the history
unwanted margin will can now be overwritten and will get pruned in v3
  • Loading branch information
matthiashader committed Feb 22, 2024
1 parent 92cfe01 commit 62b7565
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 37 deletions.
16 changes: 9 additions & 7 deletions packages/angular-test-app/src/preview-examples/message-bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ import { Component } from '@angular/core';
@Component({
selector: 'app-example',
template: `
<ix-message-bar>Message text</ix-message-bar>
<ix-message-bar type="warning">Message text</ix-message-bar>
<ix-message-bar type="danger">
<div class="d-flex align-items-center justify-content-between">
Message text <ix-button>Action</ix-button>
</div>
</ix-message-bar>
<div style='margin: 0.5rem'>
<ix-message-bar style="margin-bottom: 0.5rem; display: block">Message text</ix-message-bar>
<ix-message-bar style="margin-bottom: 0.5rem; display: block" type="warning">Message text</ix-message-bar>
<ix-message-bar style="display: block" type="danger">
<div class="d-flex align-items-center justify-content-between">
Message text <ix-button>Action</ix-button>
</div>
</ix-message-bar>
</div>
`,
})
export default class MessageBar {}
2 changes: 1 addition & 1 deletion packages/core/scss/theme/classic-dark/_borderRadius.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
--theme-upload--border-radius: var(--theme-default-border-radius);
--theme-workflow--border-radius: var(--theme-default-border-radius);
}
}
}
2 changes: 1 addition & 1 deletion packages/core/scss/theme/classic-dark/_borderWidth.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
--theme-modal--border-thickness: 0.0625rem;
--theme-toast--border-thickness: 0rem;
}
}
}
2 changes: 1 addition & 1 deletion packages/core/scss/theme/classic-light/_borderRadius.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
--theme-upload--border-radius: var(--theme-default-border-radius);
--theme-workflow--border-radius: var(--theme-default-border-radius);
}
}
}
2 changes: 1 addition & 1 deletion packages/core/scss/theme/classic-light/_borderWidth.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
--theme-modal--border-thickness: 0.0625rem;
--theme-toast--border-thickness: 0rem;
}
}
}
4 changes: 2 additions & 2 deletions packages/core/src/components/message-bar/message-bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

:host {
@include ix-component;
margin: $small-space $small-space 0rem $small-space;

.message-container {
display: flex;
Expand All @@ -21,7 +22,6 @@
flex-wrap: nowrap;
justify-content: space-between;
min-height: 3.375rem;
margin: $small-space $small-space 0rem $small-space;
padding: calc(#{$medium-space} - var(--theme-message-bar--border-thickness))
$medium-space
calc(#{$medium-space} - var(--theme-message-bar--border-thickness))
Expand Down Expand Up @@ -51,7 +51,7 @@
align-self: center;
min-height: 1.25rem;
padding: 0 $default-space;
font-weight: bold;
font-weight: normal;
white-space: normal;
}

Expand Down
8 changes: 5 additions & 3 deletions packages/core/src/tests/message-bar/basic/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
<title>Stencil Component Starter</title>
</head>
<body>
<ix-message-bar>Message text</ix-message-bar>
<ix-message-bar type="warning">Message text</ix-message-bar>
<ix-message-bar type="danger">
<div style="margin: 0.5rem; display: block">
<ix-message-bar style="margin-bottom: 0.5rem; display: block">Message text</ix-message-bar>
<ix-message-bar style="margin-bottom: 0.5rem; display: block" type="warning">Message text</ix-message-bar>
<ix-message-bar style="display: block" type="danger">
<div class="d-flex align-items-center justify-content-between">
Message text <ix-button>Action</ix-button>
</div>
</ix-message-bar>
</div>
<script src="http://127.0.0.1:8080/scripts/e2e/load-e2e-runtime.js"></script>
</body>
</html>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 9 additions & 7 deletions packages/html-test-app/src/preview-examples/message-bar.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@
<head> </head>
<body class="theme-brand-dark">
<!-- Preview code -->
<ix-message-bar>Message text</ix-message-bar>
<ix-message-bar type="warning">Message text</ix-message-bar>
<ix-message-bar type="danger">
<div class="d-flex align-items-center justify-content-between">
Message text <ix-button>Action</ix-button>
</div>
</ix-message-bar>
<div style='padding: 0.5rem'>
<ix-message-bar style="margin-bottom: 0.5rem; display: block">Message text</ix-message-bar>
<ix-message-bar style="margin-bottom: 0.5rem; display: block" type="warning">Message text</ix-message-bar>
<ix-message-bar style="display: block" type="danger">
<div class="d-flex align-items-center justify-content-between">
Message text <ix-button>Action</ix-button>
</div>
</ix-message-bar>
</div>
<!-- Preview code -->
<script type="module" src="./init.js"></script>
</body>
Expand Down
16 changes: 9 additions & 7 deletions packages/react-test-app/src/preview-examples/message-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ import React from 'react';
export default () => {
return (
<>
<IxMessageBar>Message text</IxMessageBar>
<IxMessageBar type="warning">Message text</IxMessageBar>
<IxMessageBar type="danger">
<div className="d-flex align-items-center justify-content-between">
Message text <IxButton>Action</IxButton>
</div>
</IxMessageBar>
<div style={{ padding: '0.5rem' }}>
<IxMessageBar style={{marginBottom: '0.5rem', display: 'block'}}>Message text</IxMessageBar>
<IxMessageBar style={{marginBottom: '0.5rem', display: 'block'}}>Message text</IxMessageBar>
<IxMessageBar style={{display: 'block'}}type="danger">
<div className="d-flex align-items-center justify-content-between">
Message text <IxButton>Action</IxButton>
</div>
</IxMessageBar>
</div>
</>
);
};
17 changes: 10 additions & 7 deletions packages/vue-test-app/src/preview-examples/message-bar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@ import { IxButton, IxMessageBar } from '@siemens/ix-vue';
</script>

<template>
<IxMessageBar>Message text</IxMessageBar>
<IxMessageBar type="warning">Message text</IxMessageBar>
<IxMessageBar type="danger">
<div className="d-flex align-items-center justify-content-between">
Message text <IxButton>Action</IxButton>
</div>
</IxMessageBar>
<div style="padding: 0.5rem">
<IxMessageBar style="margin-bottom: 0.5rem; display: block">Message text</IxMessageBar>
<IxMessageBar style="margin-bottom: 0.5rem; display: block" type="warning">Message text</IxMessageBar>
<IxMessageBar style="display: block" type="danger">
<div className="d-flex align-items-center justify-content-between">
Message text <IxButton>Action</IxButton>
</div>
</IxMessageBar>
</div>

</template>

0 comments on commit 62b7565

Please sign in to comment.