-
Notifications
You must be signed in to change notification settings - Fork 95
fix(NcDateTimePicker): correctly import library CSS #7051
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@susnux Is this (roughly) what you had in mind? It works in the Tasks app, but there are still issues:
|
Fixable by adding |
I'd consider changing CSS variables here a breaking change for the library as it is a public API for theming. And anyway, it is less dangerous than overriding many other styles in this component. |
|
Ok, I think this now passes as a PoC. I will try to fix the remaining issues over the weekend if I have time. |
Could you elaborate, what you mean? |
The style adjustments we do are not applied yet, if the picker is appended to body, because the css classes are not correct yet. You can see this at the buttons at the top or the highlight color. |
|
The styles are adjusted now and work for |
It seems the button server styles are not applied anymore, because they are overwritten by vuepic styles with higher priority now. |
657ef9f to
98a2b34
Compare
|
The styles are now in line with server and I hope to have fixed everything. Please review again. |
Fix is in #7103. |
| :deep(.dp__input) { | ||
| margin: 3px; | ||
| margin-inline-start: 0; | ||
| padding: 0 12px; | ||
| font-size: var(--default-font-size); | ||
| background-color: var(--color-main-background); | ||
| color: var(--color-main-text); | ||
| border: 2px solid var(--color-border-maxcontrast); | ||
| outline: none; | ||
| border-radius: var(--border-radius-large); | ||
| text-overflow: ellipsis; | ||
| cursor: pointer; | ||
| } | ||
| :deep(.dp__btn), | ||
| :deep(.dp--time-overlay-btn), | ||
| :deep(.dp__action_button) { | ||
| margin: 0; | ||
| font-weight: bold; | ||
| border-radius: var(--border-radius-element); | ||
| padding: calc((var(--default-clickable-area) - 1lh) / 2) calc(3 * var(--default-grid-baseline)); | ||
| font-size: var(--default-font-size); | ||
| width: auto; | ||
| min-height: var(--default-clickable-area); | ||
| cursor: pointer; | ||
| box-sizing: border-box; | ||
| color: var(--color-primary-element-light-text); | ||
| background-color: var(--color-primary-element-light); | ||
| border: none; | ||
| } | ||
| :deep(.dp--time-overlay-btn), | ||
| :deep(.dp__action_button) { | ||
| margin: 3px; | ||
| margin-inline-start: 0; | ||
| } | ||
| :deep(.dp__inc_dec_button) { | ||
| padding: calc((var(--default-clickable-area) - 20px) / 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it needed only after scoping or a new change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might not necessarily be related to scoping. I think it depends in which order the server and library styles are included, which might be arbitrary. If server styles come after the library styles, it works fine. But if not, the library styles overwrite the server styles (mainly the ones for button) and the style looks broken.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it should not be needed, at least many of this styles are already configured by overwriting the variable of the library.
For example the font-size is already configured by --dp-font-size and should not be needed to again configure for all this classes here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, if it's not done, then the style is off. But I am fine with any other solution you have.
I just want this issue to be solved and you see my solution here. Please, feel free to adjust it to your liking.
|
Can we merge this for the next RC, please? It's really an annoying issue for apps. |
| --dp-menu-appear-transition-timing: cubic-bezier(.4, 0, 1, 1); | ||
| --dp-transition-timing: ease-out; | ||
| --dp-action-row-transtion: all 0.2s ease-in; | ||
| --dp-font-family: -apple-system, blinkmacsystemfont, "Segoe UI", roboto, oxygen, ubuntu, cantarell, "Open Sans", "Helvetica Neue", sans-serif; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should probably use our styles here
susnux
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| :input-label="t('Timezone')" /> | ||
| </template> | ||
| </VueDatePicker> | ||
| <span class="vue-date-time-picker__wrapper"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick, but it is not valid BEM structure - element cannot be a parent of its own block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do this also in other places 😅
Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
* don't import Teleport * fix CSS import for styleguide * fix styles for appendToBody Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
- use BEM syntax Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
…lash with server rules Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
6b6c4e2 to
3762252
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested. Not sure if related to this PR, but some format options are no longer valid
E.g. YYYY -> yyyy and DD - dd
https://github.com/date-fns/date-fns/blob/main/docs/unicodeTokens.md



☑️ Resolves
This adjusts the CSS import of the
NcDateTimePickervendor styles to not be scoped. I don't know if this is the proper way to handle this issue, so plead advise if not.🖼️ Screenshots
🏁 Checklist
stable8for maintained Vue 2 version or not applicable