11import styled from "@emotion/styled" ;
22import { Dimensions , Position } from "../../hooks/useDragToResize" ;
3- import { transparentize } from "polished" ;
3+ import { darken , transparentize } from "polished" ;
44
55interface StyledBorderedAppProps {
66 initialDimensions : Dimensions ;
@@ -24,7 +24,7 @@ export const StyledBorderedApp = styled.div<StyledBorderedAppProps>`
2424 border-radius: 10px;
2525 box-shadow:
2626 0px -2px 10px 1px rgb(0, 0, 0, 0.4),
27- 0px 0px 3px rgb(141, 141, 141, 0.5) inset;
27+ 0px 0px 3px ${ transparentize ( 0.5 , "#8d8d8d" ) } inset;
2828 position: fixed;
2929 width: ${ ( props ) => props . initialDimensions . width } px;
3030 height: ${ ( props ) => props . initialDimensions . height } px;
@@ -126,9 +126,11 @@ function getButtonBackgroundColor(type: ButtonType): string {
126126 }
127127}
128128
129- export const StyledWindowButton = styled . button < {
129+ interface StyledWindowButtonProps {
130130 buttonType : ButtonType ;
131- } > `
131+ frameColor : string ;
132+ }
133+ export const StyledWindowButton = styled . button < StyledWindowButtonProps > `
132134 border-radius: 20px;
133135 width: 14px;
134136 height: 14px;
@@ -137,12 +139,21 @@ export const StyledWindowButton = styled.button<{
137139 transition: all 0.2s ease;
138140 background-color: ${ ( props ) => getButtonBackgroundColor ( props . buttonType ) } ;
139141 border: none;
142+ box-shadow:
143+ inset 0 0 0 0.5px ${ ( p ) => transparentize ( 0.5 , darken ( 0.1 , p . frameColor ) ) } ,
144+ inset 0 1px 2px rgba(255, 255, 255, 0.3),
145+ 0 1px 5px ${ ( p ) => transparentize ( 0.5 , darken ( 0.1 , p . frameColor ) ) } ;
146+
140147 &:hover {
141148 transform: scale(1.2);
142149 transition: all 0.2s ease;
143150 }
144151 &:active {
145- box-shadow: 2px 2px 4px rgb(0, 0, 0, 0.5) inset;
152+ box-shadow:
153+ inset 1px 1px 2px 1px
154+ ${ ( p ) => transparentize ( 0.5 , darken ( 0.1 , p . frameColor ) ) } ,
155+ inset 0 1px 2px ${ ( p ) => transparentize ( 0.5 , darken ( 0.1 , p . frameColor ) ) } ,
156+ 0 1px 5px ${ ( p ) => transparentize ( 0.5 , darken ( 0.1 , p . frameColor ) ) } ;
146157 }
147158` ;
148159
0 commit comments