Skip to content

Commit

Permalink
fix: fix tags container max width
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonella Sgarlatta committed Jun 2, 2021
1 parent 30ee2e9 commit 9be9ba2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/assets/javascripts/components/NoteTagsContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const NoteTagsContainer = observer(({ application, appState }: Props) => {

return (
<div
className="bg-default flex flex-wrap pl-1 -ml-1"
className="bg-default flex flex-wrap pl-1 -ml-1 -ml-2"
style={{
maxWidth: tagsContainerMaxWidth,
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,10 @@ export class ActiveNoteState {

reloadTagsContainerMaxWidth(): void {
const EDITOR_ELEMENT_ID = 'editor-column';
const defaultFontSize = parseFloat(window.getComputedStyle(
document.documentElement
).fontSize);
const margins = defaultFontSize * 1.5;
const editorWidth = document.getElementById(EDITOR_ELEMENT_ID)?.clientWidth;
if (editorWidth) {
this.appState.activeNote.setTagsContainerMaxWidth(
editorWidth - margins
editorWidth
);
}
}
Expand Down
4 changes: 4 additions & 0 deletions app/assets/stylesheets/_sn.scss
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@
margin-left: -0.25rem;
}

.-ml-2 {
margin-right: -0.5rem;
}

.-mr-1 {
margin-right: -0.25rem;
}
Expand Down

0 comments on commit 9be9ba2

Please sign in to comment.