tasks
tasks copied to clipboard
Remove extra css margin for URL in task title
Small bits of polish like this can make a big difference in how the app feels :)
Steps to reproduce
- Add a new task with a URL as the title https://wikipedia.org
Expected behavior
The task title is in line with non-URL titles
Actual behaviour
It is off by 3px
Towards solutions
This appears to be caused by the a.external CSS which adds a margin.
a.external {
margin: 0 3px;
text-decoration: underline;
}
Looks like it actually comes from here in nextcloud/server/.../styles.scss.
The external class is added by calling linkify on this line: https://github.com/nextcloud/tasks/blob/8a1a4ab193e02a0c3e9c22817e39e46c99b6e180/src/components/TaskBody.vue#L53
The linkify function always adds the external class: https://github.com/nextcloud-libraries/nextcloud-vue/blob/87322fabb7f12ed9a64862903a204969ee45c632/src/utils/Linkify.js#L30-L39
So the way I see it there are a few options:
- Add our a CSS to taskbody.vue that looks something like:
.task-body__info .title a { margin: unset; }- Easy to do but maybe not the best for maintainability
- change styles.scss in nextcloud/server
- Probably not a good idea since it may be used many places but at the same time. But why would all external links in all of nextcloud be indented by 3px? Maybe this should be fixed?
- The Margin was added way back in https://github.com/nextcloud/server/pull/7680 for a specific use case
- Don't use linkify
- Honestly not totally sure of the purpose/history of linkify. It's probably there for a reason.
- Modify linkify to have an option to not add the external class.
- Seems not ideal