-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Rename theme variables to global variables, and separate them i…
…nto theme and layout groups
- Loading branch information
Showing
10 changed files
with
140 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
id: global-variables | ||
sidebar_position: 2 | ||
title: Global variables | ||
--- | ||
|
||
import SDKSpecific from './SDKSpecific'; | ||
|
||
CSS variables are the easiest way to customize the theme. The variables are organized into two layers: | ||
|
||
- Global | ||
- Component | ||
|
||
This page contains information about the global variables. | ||
|
||
Global variables can be grouped into the following categories: | ||
|
||
- Theme: colors, typography and border radiuses | ||
- Layout: spacing (padding and margin) and sizing | ||
|
||
You can read about each category in detail in the tables below. | ||
|
||
## Theme variables | ||
|
||
[//]: # '#SLOT-autogenerated-theme-variables' | ||
|
||
All global theme variables are defined in: [https://github.com/GetStream/stream-chat-css/blob/main/src-v2/styles/\_global-theme-variables.scss](https://github.com/GetStream/stream-chat-css/blob/main/src-v2/styles/_global-theme-variables.scss) | ||
|
||
## Layout variables | ||
|
||
[//]: # '#SLOT-autogenerated-layout-variables' | ||
|
||
All global theme variables are defined in: [https://github.com/GetStream/stream-chat-css/blob/main/src-v2/styles/\_global-layout-variables.scss](https://github.com/GetStream/stream-chat-css/blob/main/src-v2/styles/_global-layout-variables.scss) | ||
|
||
If you find that these variables are too high-level and you need more granular control, you also have the option to provide [component layer overrides](./component-variables.mdx). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// Since Angular uses dynamic components it's not enough the hide the message input for theme-v1/v2, we have to remove it from the DOM tree | ||
// Angular component lifecycle requires us to place this on the root level | ||
:root { | ||
/* The theme version being used, 1 or 2. Used internally by SDKs */ | ||
--str-chat__theme-version: 2; | ||
} | ||
|
||
.str-chat { | ||
/* Used for elements where sizing is necessary (such as icons, avatar), you can use this variable to scale those elements */ | ||
--str-chat__spacing-px: 1px; | ||
|
||
/* Used for margins and paddings */ | ||
--str-chat__spacing-0_5: 0.125rem; | ||
|
||
/* Used for margins and paddings */ | ||
--str-chat__spacing-1: 0.25rem; | ||
|
||
/* Used for margins and paddings */ | ||
--str-chat__spacing-1_5: 0.375rem; | ||
|
||
/* Used for margins and paddings */ | ||
--str-chat__spacing-2: 0.5rem; | ||
|
||
/* Used for margins and paddings */ | ||
--str-chat__spacing-2_5: 0.625rem; | ||
|
||
/* Used for margins and paddings */ | ||
--str-chat__spacing-3: 0.75rem; | ||
|
||
/* Used for margins and paddings */ | ||
--str-chat__spacing-3_5: 0.875rem; | ||
|
||
/* Used for margins and paddings */ | ||
--str-chat__spacing-4: 1rem; // 16px by default | ||
|
||
/* Used for margins and paddings */ | ||
--str-chat__spacing-5: 1.25rem; | ||
|
||
/* Used for margins and paddings */ | ||
--str-chat__spacing-6: 1.5rem; | ||
|
||
/* Used for margins and paddings */ | ||
--str-chat__spacing-7: 1.75rem; | ||
|
||
/* Used for margins and paddings */ | ||
--str-chat__spacing-8: 2rem; | ||
|
||
/* Used for margins and paddings */ | ||
--str-chat__spacing-9: 2.25rem; | ||
|
||
/* Used for margins and paddings */ | ||
--str-chat__spacing-10: 2.5rem; | ||
|
||
/* Used for margins and paddings */ | ||
--str-chat__spacing-11: 2.75rem; | ||
|
||
/* Used for margins and paddings */ | ||
--str-chat__spacing-12: 3rem; | ||
|
||
/* Used for margins and paddings */ | ||
--str-chat__spacing-14: 3.5rem; | ||
|
||
/* Used for margins and paddings */ | ||
--str-chat__spacing-16: 4rem; | ||
} |
64 changes: 0 additions & 64 deletions
64
src/v2/styles/_theme-variables.scss → src/v2/styles/_global-theme-variables.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters