editor.js/src/styles/variables.css
Peter Savchenko ff91466b14
feat(toolbar): toolbar refactored and ui improved (#1815)
* chore(block-tune-toggler): toggler moved to the left (draft)

* toolbox ui updated

* fixd caret jumpling, improved some styles

* toolbar moving by block-hover

- UI module triggers 'block-hovered' event
- Toolbar uses 'block-hovered' for appearing
- `currentBlock` setter added to the BlockManager
- (reactangle-selection): the throttling added to the mousemove and scroll handlers
- `getBlockIndex` method added to the Api
- (api-blocks): toolbar moving logic removed from `blocks.move()` and `blocks.swap()` methods. Instead, MoveUp and MoveDown tunes uses Toolbar API

* the dark-theme to the example-dev.html

* positioning improved

* fix(rectangle-selection): first click after RS does not clears selection state

* toolbox position fixed

* the toolbox module became a standalone class

- Toolbox became a standalone class from the editor module. It can be accessed only via the owner (the Toolbar module)
- (api.blocks) the insert() method now has the `replace` param. Also, it returns inserted Block API now.

* new(api.listeners): `on()` now returns the listener id. The new `offById()` method added

* fix bug with Tab pressing on hovered but not focused block

* mobile version improved

* upd example dev

* small updaets

* add nested-list

* linting

* (api.toolbar): `toggleBlockSettings` now fires toggling event with the same state

* EventDispatcher used instead of callbacks for the Toolbox

* UIApi added

* fix ci

* git submodules removed from the ci flow

* add paragraph submodule to the ci flow

* Update CHANGELOG.md

* Update package.json

* use ubuntu-latest for chrome ci
2021-11-24 21:14:24 +03:00

169 lines
3.1 KiB
CSS

@custom-media --mobile (width <= 650px);
@custom-media --not-mobile (width >= 651px);
:root {
/**
* Selection color
*/
--selectionColor: #e1f2ff;
--inlineSelectionColor: #d4ecff;
/**
* Toolbar buttons
*/
--bg-light: #eff2f5;
/**
* All gray texts: placeholders, settings
*/
--grayText: #707684;
/**
* Gray icons hover
*/
--color-dark: #1D202B;
/**
* Blue icons
*/
--color-active-icon: #388AE5;
/**
* Gray border, loaders
*/
--color-gray-border: rgba(201, 201, 204, 0.48);
/**
* Block content width
* Should be set in a constant at the modules/ui.js
*/
--content-width: 650px;
/**
* In narrow mode, we increase right zone contained Block Actions button
*/
--narrow-mode-right-padding: 50px;
/**
* Toolbar buttons height and width
*/
--toolbar-buttons-size: 34px;
/**
* Toolbar Plus Button and Toolbox buttons height and width
*/
--toolbox-buttons-size: 26px;
--toolbox-buttons-size--mobile: 36px;
/**
* The main `.cdx-block` wrapper has such vertical paddings
* And the Block Actions toggler too
*/
--block-padding-vertical: 0.4em;
/**
* Confirm deletion bg
*/
--color-confirm: #E24A4A;
--overlay-pane: {
position: absolute;
background-color: #FFFFFF;
border: 1px solid #E8E8EB;
box-shadow: 0 3px 15px -3px rgba(13,20,33,0.13);
border-radius: 6px;
z-index: 2;
@media (--mobile){
box-shadow: 0 8px 6px -6px rgb(33 48 73 / 19%);
border-bottom-color: #c7c7c7;
}
&--left-oriented {
&::before {
left: 15px;
margin-left: 0;
}
}
&--right-oriented {
&::before {
left: auto;
right: 15px;
margin-left: 0;
}
}
};
/**
* Styles for Toolbox Buttons and Plus Button
*/
--toolbox-button: {
color: var(--color-dark);
cursor: pointer;
width: var(--toolbox-buttons-size);
height: var(--toolbox-buttons-size);
border-radius: 3px;
display: inline-flex;
justify-content: center;
align-items: center;
@media (--mobile){
width: var(--toolbox-buttons-size--mobile);
height: var(--toolbox-buttons-size--mobile);
}
&:hover,
&--active {
background-color: var(--bg-light);
}
&--active{
animation: bounceIn 0.75s 1;
animation-fill-mode: forwards;
}
};
/**
* Styles for Settings Button in Toolbar
*/
--toolbar-button: {
display: inline-flex;
align-items: center;
justify-content: center;
width: 34px;
height: 34px;
line-height: 34px;
padding: 0 !important;
text-align: center;
border-radius: 3px;
cursor: pointer;
border: 0;
outline: none;
background-color: transparent;
vertical-align: bottom;
color: #000;
margin: 0;
&:hover {
background-color: var(--bg-light);
}
&--active {
color: var(--color-active-icon);
}
&--focused {
box-shadow: inset 0 0 0px 1px rgba(7, 161, 227, 0.08);
background: rgba(34, 186, 255, 0.08) !important;
&-animated {
animation-name: buttonClicked;
animation-duration: 250ms;
}
}
};
}