Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Removing the unneeded negative margin trick used to position icons. #10002

Closed
wants to merge 3 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions src/styles/jsTreeTheme.less
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,14 @@ li.jstree-closed > ul { display:none; }

@jstree-icon-backindent: 12px;

/* Make the links in the JS tree the width of the container
* by shifting the off the screen by negative margin and moving the
* content back by pushing the padding. The icons are positioned absolute
* relative to the containing list item so they sit above the a's background.
* This also means we need to include the size of the sprite in the padding
* so the text ends up back in the same spot visually
*/
.jstree-brackets li > a {
@jstree-icon-text-overlap: 2px;
padding-left: (@jstree-sprite-size - @jstree-icon-backindent - @jstree-icon-text-overlap + 10000px);
margin-left: -10000px;
padding-left: (@jstree-sprite-size - @jstree-icon-backindent - @jstree-icon-text-overlap);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good as a fix/workaround for #9965.

display: block;

/* Explicitly remove the focus ring to fix https://github.com/adobe/brackets/issues/9987 */
box-shadow: none;
outline: none;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For #9987, it seems like we should just fix the bug that's causing the sidebar to get focus in the first place -- then we wouldn't need this change.

I thought that focus bug (which also occurs on master) was filed, but it looks like I was wrong. I only see #9414, but that's a lower-priority bug about temporary focus loss when clicking a file -- the issue we're seeing lately is persistent focus loss when clicking a folder. I think we can just use #9987 to track that issue, since fixing the focus loss itself seems like the right fix for the visible focus ring.

}

.jstree li {
Expand Down