Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FRNT-492] Fix styled types in header panel and add css prop for shadow #96

Merged
merged 3 commits into from
May 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/lib/box-styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const Global = styled.div`
--woly-border-width: 1.5px;
--woly-rounding: 4px;
--woly-font-size: 15px;
--woly-shadow: 3px 3px 9px rgba(57, 57, 57, 0.12);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Там есть perfect shadow и shadow. Тут именно обычная тенюшка?


--woly-const-m: 6px;
--woly-main-level: 3;
Expand Down
8 changes: 3 additions & 5 deletions src/ui/atoms/header-panel/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components';
import styled, { StyledComponent } from 'styled-components';
import { Variant } from 'lib/types';

const map = (properties: Variant) => ({
Expand All @@ -17,12 +17,10 @@ export const HeaderPanel = styled.div.attrs(map)`
var(--woly-const-m) + (1px * var(--woly-main-level)) + var(--local-vertical)
);

--local-box-shadow: 3px 3px 9px rgba(57, 57, 57, 0.12);

padding: var(--local-vertical) var(--local-horizontal);

background-color: var(--woly-background);
border: var(--woly-border-width) solid var(--woly-background);
border-radius: var(--woly-rounding);
box-shadow: var(--local-box-shadow);
`;
box-shadow: var(--woly-shadow);
` as StyledComponent<'div', Record<string, unknown>, Variant>;
5 changes: 4 additions & 1 deletion src/ui/atoms/header-panel/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ import { CloseIcon } from 'icons';

`HeaderPanel` is a navigation component that displays information and actions relating to the current screen.

### Example

<Playground>
<div style={{ marginBottom: '10px' }}>
<HeaderPanel>Hello! It`s a HeaderPanel</HeaderPanel>
</div>
</Playground>
### Example

### Menu example

<Playground>
<State initial={false} change={(i) => !i}>
Expand Down
2 changes: 1 addition & 1 deletion src/ui/atoms/tooltip/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export const Tooltip = styled(TooltipBase)`
z-index: 1;
opacity: 0;
cursor: pointer;
box-shadow: 3px 3px 9px rgba(57, 57, 57, 0.12);
box-shadow: var(--woly-shadow);
width: max-content;
min-width: 112px;
max-width: 240px;
Expand Down
2 changes: 1 addition & 1 deletion src/ui/molecules/select/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export const Select = styled(SelectBase)`
padding: 0;
z-index: 1;
margin-top: 6px;
box-shadow: 3px 3px 9px rgba(57, 57, 57, 0.12);
box-shadow: var(--woly-shadow);
}
ul[data-visible='true'] {
display: flex;
Expand Down