From 5ccd61543d3e02c712146106e3c4cd47c33541b4 Mon Sep 17 00:00:00 2001 From: Adi Dahiya Date: Mon, 2 May 2022 22:13:36 +0000 Subject: [PATCH] [datetime] merge overrides into component styles --- packages/datetime/src/_datepicker.scss | 10 +++- packages/datetime/src/_daterangepicker.scss | 6 ++- packages/datetime/src/blueprint-datetime.scss | 52 +------------------ 3 files changed, 15 insertions(+), 53 deletions(-) diff --git a/packages/datetime/src/_datepicker.scss b/packages/datetime/src/_datepicker.scss index a56c20ca44..9f721f87c6 100644 --- a/packages/datetime/src/_datepicker.scss +++ b/packages/datetime/src/_datepicker.scss @@ -130,6 +130,10 @@ $header-margin: ($header-height - $pt-input-height) * 0.5 !default; &:hover { background-color: $blue2; } + + &:active { + background-color: $blue1; + } } // putting it last so it overrides equally specific selectors above. @@ -231,7 +235,11 @@ $header-margin: ($header-height - $pt-input-height) * 0.5 !default; background-color: $blue3; &:hover { - background-color: $blue4; + background-color: $blue2; + } + + &:active { + background-color: $blue1; } } diff --git a/packages/datetime/src/_daterangepicker.scss b/packages/datetime/src/_daterangepicker.scss index 7b66bc7969..c92afe17cc 100644 --- a/packages/datetime/src/_daterangepicker.scss +++ b/packages/datetime/src/_daterangepicker.scss @@ -36,6 +36,7 @@ } &--hovered-range { + color: $blue2; border-radius: 0; // need to disable hover styles for all variants of selected dates @@ -50,9 +51,11 @@ &--selected-range { background-color: $daterangepicker-range-background-color-selected; border-radius: 0; + color: $blue2; &:hover { background-color: $daterangepicker-range-background-color-selected-hover; + color: $blue2; } } @@ -84,7 +87,7 @@ .#{$ns}-dark & { .DayPicker-Day { &--hovered-range { - // same for dark theme + color: $light-gray5; /* stylelint-disable max-line-length */ &:not(.DayPicker-Day--selected):not(.DayPicker-Day--selected-range):not(.DayPicker-Day--selected-range-start):not(.DayPicker-Day--selected-range-end) { @@ -95,6 +98,7 @@ &--selected-range { background-color: $dark-daterangepicker-range-background-color-selected; + color: $light-gray5; &:hover { background-color: $dark-daterangepicker-range-background-color-selected-hover; diff --git a/packages/datetime/src/blueprint-datetime.scss b/packages/datetime/src/blueprint-datetime.scss index 4fd857f1ab..430c886684 100644 --- a/packages/datetime/src/blueprint-datetime.scss +++ b/packages/datetime/src/blueprint-datetime.scss @@ -1,58 +1,8 @@ -// Copyright 2017 Palantir Technologies, Inc. All rights reserved. +// Copyright 2015 Palantir Technologies, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0. -@import "~@blueprintjs/colors/lib/scss/colors"; - @import "datepicker"; @import "daterangepicker"; @import "timepicker"; @import "datetimepicker"; @import "dateinput"; - -/* stylelint-disable selector-class-pattern */ - -.#{$ns}-datepicker, .#{$ns}-daterangepicker { - .DayPicker-Day { - &.DayPicker-Day--selected { - &:active { - background-color: $blue1; - } - - .#{$ns}-dark & { - &:hover { - background-color: $blue2; - } - - &:active { - background-color: $blue1; - } - } - } - } -} - -.#{$ns}-daterangepicker { - .DayPicker-Day { - &--hovered-range { - color: $blue2; - } - - &--selected-range { - color: $blue2; - - &:hover { - color: $blue2; - } - } - - .#{$ns}-dark & { - &--hovered-range { - color: $light-gray5; - } - - &--selected-range { - color: $light-gray5; - } - } - } -}