Skip to content

Commit

Permalink
Update: Improve and simplify annotation button and icon styles (#318)
Browse files Browse the repository at this point in the history
  • Loading branch information
jstoffan authored Dec 19, 2018
1 parent 6f9d783 commit 538fbd2
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 65 deletions.
29 changes: 12 additions & 17 deletions src/components/ActionControls/DrawingControls.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,23 @@

.ba {
.ba-action-controls-draw {
$button-spacing: 5px;

display: flex;
}
margin-left: -#{$button-spacing};
margin-right: -#{$button-spacing};

.ba-action-controls-draw .btn-plain {
flex-grow: 1;
padding-left: 5px;
padding-right: 5px;
.btn-plain {
flex-grow: 1;
padding-left: $button-spacing;
padding-right: $button-spacing;

.fill-color {
fill: $sevens;
.fill-color {
fill: $sevens;
}
}
}

.icon-trash {
margin-top: 4px;
}

.ba-action-controls-draw .btn-plain:hover {
padding-left: 5px;
padding-right: 5px;

.fill-color {
.btn-plain:hover .fill-color {
fill: $better-black;
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/components/ActionControls/HighlightControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ const HighlightControls = ({
{canAnnotateAndDelete && (
<PlainButton type='button' className={CLASS_HIGHLIGHT_BTN} onClick={isPending ? onCreate : onDelete}>
<IconHighlightAnnotation
height={20}
width={20}
className={classNames({
[CLASS_SAVED_HIGHLIGHT]: !isPending
})}
Expand All @@ -42,7 +44,7 @@ const HighlightControls = ({
)}
{canComment && (
<PlainButton type='button' className={CLASS_HIGHLIGHT_COMMENT_BTN} onClick={onCommentClick}>
<IconHighlightCommentAnnotation height={24} width={24} />
<IconHighlightCommentAnnotation height={20} width={20} />
</PlainButton>
)}
</div>
Expand Down
53 changes: 27 additions & 26 deletions src/components/ActionControls/HighlightControls.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,36 @@

.ba {
.ba-action-controls-highlight {
display: flex;
}

.ba-action-controls-highlight .btn-plain {
flex-grow: 1;
padding-left: 5px;
padding-right: 5px;
}

.icon-annotation-highlight,
.icon-annotation-highlight-comment .icon {
fill: $sevens;
}
$button-spacing: 5px;

.ba-saved-highlight {
fill: $highlight-yellow;
}

.ba-action-controls-highlight .btn-plain:hover {
padding-left: 5px;
padding-right: 5px;

.icon-annotation-highlight,
.icon-annotation-highlight-comment .icon {
fill: $better-black;
display: flex;
margin-left: -#{$button-spacing};
margin-right: -#{$button-spacing};

.btn-plain {
flex-grow: 1;
padding-left: $button-spacing;
padding-right: $button-spacing;

.icon-annotation-highlight,
.icon-annotation-highlight-comment .icon {
fill: $sevens;
}

.icon-annotation-highlight.ba-saved-highlight {
fill: $highlight-yellow;
}
}

.icon-annotation-highlight.ba-saved-highlight {
fill: $highlight-yellow-hover;
.btn-plain:hover {
.icon-annotation-highlight,
.icon-annotation-highlight-comment .icon {
fill: $better-black;
}

.icon-annotation-highlight.ba-saved-highlight {
fill: $highlight-yellow-hover;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ exports[`components/ActionControls/HighlightControls should correctly render pen
>
<IconHighlightAnnotation
className=""
height={24}
width={24}
height={20}
width={20}
/>
</PlainButton>
<PlainButton
Expand All @@ -22,8 +22,8 @@ exports[`components/ActionControls/HighlightControls should correctly render pen
>
<IconHighlightCommentAnnotation
className=""
height={24}
width={24}
height={20}
width={20}
/>
</PlainButton>
</div>
Expand All @@ -40,8 +40,8 @@ exports[`components/ActionControls/HighlightControls should correctly render pen
>
<IconHighlightAnnotation
className=""
height={24}
width={24}
height={20}
width={20}
/>
</PlainButton>
</div>
Expand All @@ -57,8 +57,8 @@ exports[`components/ActionControls/HighlightControls should correctly render sav
>
<IconHighlightAnnotation
className="ba-saved-highlight"
height={24}
width={24}
height={20}
width={20}
/>
</PlainButton>
<PlainButton
Expand All @@ -68,8 +68,8 @@ exports[`components/ActionControls/HighlightControls should correctly render sav
>
<IconHighlightCommentAnnotation
className=""
height={24}
width={24}
height={20}
width={20}
/>
</PlainButton>
</div>
Expand All @@ -85,8 +85,8 @@ exports[`components/ActionControls/HighlightControls should correctly render sav
>
<IconHighlightAnnotation
className="ba-saved-highlight"
height={24}
width={24}
height={20}
width={20}
/>
</PlainButton>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/AnnotationPopover/AnnotationPopover.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class AnnotationPopover extends React.PureComponent<Props> {
{isMobile ? (
<span className={CLASS_MOBILE_HEADER} style={{ height: headerHeight }}>
<PlainButton className={CLASS_MOBILE_CLOSE_BTN} onClick={onCancel}>
<IconClose height={24} width={24} />
<IconClose height={20} width={20} />
</PlainButton>
</span>
) : (
Expand Down
3 changes: 2 additions & 1 deletion src/components/AnnotationPopover/AnnotationPopover.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@
display: block;
overflow-x: hidden;
overflow-y: auto;
padding: 15px;
padding: 10px;
white-space: normal;
}

.ba-inline-popover .overlay {
align-items: center;
display: inline-flex;
}

Expand Down
4 changes: 0 additions & 4 deletions src/components/AnnotationPopover/AnnotatorLabel.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
@import '../../variables';

.ba {
.ba-annotator-label {
line-height: 23px;
}

// MOBILE & TABLET CSS
@media #{$mobile}, #{$tablet} {
.ba-annotator-label {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ exports[`components/AnnotationPopover should correctly render a div without a Fo
}
>
<IconClose
height={24}
width={24}
height={20}
width={20}
/>
</PlainButton>
</span>
Expand Down
2 changes: 1 addition & 1 deletion src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export const POINT_ANNOTATION_ICON_HEIGHT = 31;
export const POINT_ANNOTATION_ICON_DOT_HEIGHT = 8;
export const POINT_ANNOTATION_ICON_WIDTH = 24;
export const ANNOTATION_POPOVER_CARET_HEIGHT = 8;
export const INLINE_POPOVER_HEIGHT = 56;
export const INLINE_POPOVER_HEIGHT = 42;

export const PAGE_PADDING_TOP = 15;
export const PAGE_PADDING_BOTTOM = 15;
Expand Down

0 comments on commit 538fbd2

Please sign in to comment.