Skip to content

Commit

Permalink
Adding mixin for button group border radius
Browse files Browse the repository at this point in the history
  • Loading branch information
elizabetdev committed Apr 12, 2021
1 parent 3d55464 commit 10b80a3
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// mapChart__legend--small
// mapChart__legend-isLoading

@import 'mixins';
@import 'main';
@import 'mapbox_hacks';
@import 'connected_components/index';
Expand Down
30 changes: 1 addition & 29 deletions x-pack/plugins/maps/public/_mapbox_hacks.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,7 @@

.mapboxgl-ctrl-group:not(:empty) {
@include euiBottomShadowLarge;

@include kbnThemeStyle($theme: 'v7') {
border-radius: $euiBorderRadius;
}

@include kbnThemeStyle($theme: 'v8') {
border-radius: $euiBorderRadius * (2 / 3);
}

@include mapToolbarButtonGroupBorderRadius;
background-color: $euiColorEmptyShade;
transition: transform $euiAnimSpeedNormal ease-in-out;

Expand All @@ -29,26 +21,6 @@
> button {
@include size($euiSizeXL);

@include kbnThemeStyle($theme: 'v7') {
&:first-child {
border-radius: $euiBorderRadius $euiBorderRadius 0 0;
}

&:last-child {
border-radius: 0 0 $euiBorderRadius $euiBorderRadius;
}
}

@include kbnThemeStyle($theme: 'v8') {
&:first-child {
border-radius: ($euiBorderRadius * (2 / 3)) ($euiBorderRadius * (2 / 3)) 0 0;
}

&:last-child {
border-radius: 0 0 ($euiBorderRadius * (2 / 3)) ($euiBorderRadius * (2 / 3));
}
}

+ button {
border: none;
}
Expand Down
11 changes: 11 additions & 0 deletions x-pack/plugins/maps/public/_mixins.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@mixin mapToolbarButtonGroupBorderRadius {
@include kbnThemeStyle($theme: 'v7') {
border-radius: $euiBorderRadius;
}

@include kbnThemeStyle($theme: 'v8') {
border-radius: $euiBorderRadiusSmall;
}

overflow: hidden;
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,30 +39,11 @@
}

.mapToolbarOverlay__buttonGroup {
@include mapToolbarButtonGroupBorderRadius;
display: flex;
flex-direction: column;

.euiButtonIcon {
border-radius: 0;

@include kbnThemeStyle($theme: 'v7') {
&:first-child {
border-radius: $euiBorderRadius $euiBorderRadius 0 0;
}

&:last-child {
border-radius: 0 0 $euiBorderRadius $euiBorderRadius;
}
}

@include kbnThemeStyle($theme: 'v8') {
&:first-child {
border-radius: ($euiBorderRadius * (2 / 3)) ($euiBorderRadius * (2 / 3)) 0 0;
}

&:last-child {
border-radius: 0 0 ($euiBorderRadius * (2 / 3)) ($euiBorderRadius * (2 / 3));
}
}
}
}
2 changes: 1 addition & 1 deletion x-pack/plugins/maps/public/lazy_load_bundle/lazy/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import '../../index.scss';
import '../../_index.scss';
export * from '../../embeddable/map_embeddable';
export * from '../../kibana_services';
export { renderApp } from '../../render_app';
Expand Down

0 comments on commit 10b80a3

Please sign in to comment.