From 9358b8d0a255aa641dd890370d19b4ef715a3822 Mon Sep 17 00:00:00 2001 From: CJ Cenizal Date: Mon, 30 Apr 2018 10:21:29 -0700 Subject: [PATCH] Move constrained max-width into a variable. --- src/components/empty_prompt/_empty_prompt.scss | 4 ++-- src/components/text/_index.scss | 2 +- src/components/text/_mixins.scss | 6 ------ src/components/text/_text.scss | 5 ++++- src/components/text/_variables.scss | 1 + 5 files changed, 8 insertions(+), 10 deletions(-) delete mode 100644 src/components/text/_mixins.scss create mode 100644 src/components/text/_variables.scss diff --git a/src/components/empty_prompt/_empty_prompt.scss b/src/components/empty_prompt/_empty_prompt.scss index e240f14983a7..a2869d5f423e 100644 --- a/src/components/empty_prompt/_empty_prompt.scss +++ b/src/components/empty_prompt/_empty_prompt.scss @@ -1,7 +1,7 @@ -@import '../text/_mixins'; +@import '../text/_variables'; .euiEmptyPrompt { - @include euiTextConstrainedWidth; + max-width: $euiTextConstrainedMaxWidth; text-align: center; padding: $euiSizeL; margin: auto; diff --git a/src/components/text/_index.scss b/src/components/text/_index.scss index ba3c99051593..10c80857c93d 100644 --- a/src/components/text/_index.scss +++ b/src/components/text/_index.scss @@ -1,4 +1,4 @@ -@import 'mixins'; +@import 'variables'; @import 'text'; @import 'text_color'; @import 'text_align'; diff --git a/src/components/text/_mixins.scss b/src/components/text/_mixins.scss deleted file mode 100644 index 4153b954bb61..000000000000 --- a/src/components/text/_mixins.scss +++ /dev/null @@ -1,6 +0,0 @@ -@mixin euiTextConstrainedWidth { - max-width: 36em; - // If the max-width is way too short of the width of the container, - // at least make it 2/3 of it's parent - min-width: 75%; -} diff --git a/src/components/text/_text.scss b/src/components/text/_text.scss index 4d18578c5790..18527fcb5386 100644 --- a/src/components/text/_text.scss +++ b/src/components/text/_text.scss @@ -193,7 +193,10 @@ @include euiScaleText($euiFontSize); &.euiText--constrainedWidth { - @include euiTextConstrainedWidth; + max-width: $euiTextConstrainedMaxWidth; + // If the max-width is way too short of the width of the container, + // at least make it 2/3 of it's parent + min-width: 75%; } &.euiText--small { diff --git a/src/components/text/_variables.scss b/src/components/text/_variables.scss new file mode 100644 index 000000000000..c924d66926f2 --- /dev/null +++ b/src/components/text/_variables.scss @@ -0,0 +1 @@ +$euiTextConstrainedMaxWidth: 36em;