PromucFlow_constructor/app/client/src/index.css
Valera Melnikov ba6262ffe6
chore: widgets alignment (#31923)
## Description
Plenty changes related to widgets alignment 
1. Paragraph, button, inputs, single checkbox and switch widgets are
aligned along the baseline of the text content
2. The icons in the buttons and the single checkbox and switch are now
positioned absolutely so as not to affect the height of the components.
The height of the components now depends on text content.
3. All unnecessary paddings and borders in the layout have been removed:
- Canvas padding: `--outer-spacing-4`
- Gap between sections and zones: `--outer-spacing-4`
- Zone padding: `--outer-spacing-3`
- Gap between widgets: `--outer-spacing-3`
4. In widget selection styles replace `border` with `outline`, since the
`outline` one does not take space.
5. Add Changes to the flex-basis calculation method. Now the gap between
the zones is taken into account there.
6. Add a lot of small fixes related to the changes described above.


https://github.com/appsmithorg/appsmith/assets/11555074/b7c220eb-3e27-4039-9c15-6281bafe8008

Fixes #29364

## Automation

/ok-to-test tags="@tag.Anvil"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!IMPORTANT]  
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/8375537665>
> Commit: `f85b63c0a49f30b9762379c2f8c3bd38c7a8355f`
> Cypress dashboard url: <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8375537665&attempt=2"
target="_blank">Click here!</a>
> All cypress tests have passed 🎉🎉🎉

<!-- end of auto-generated comment: Cypress test results  -->




<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary by CodeRabbit

- **New Features**
	- Improved handling of CSS variable values in Flex components.
- Enhanced styling and layout configurations for a better user
experience.
- **Bug Fixes**
- Fixed label positioning and styling issues in Checkbox and Switch
components.
	- Adjusted padding, margin, and sizing for consistency and alignment.
- **Refactor**
- Enhanced flex layout handling and space distribution logic for
improved layout flexibility.
- **Style**
	- Updated component styles for refined user interface aesthetics.
- **Chores**
- Updated feature flags and configurations for widgets and components to
enable new functionalities.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-03-22 16:53:29 +03:00

292 lines
7.1 KiB
CSS
Executable File

@import "~normalize.css";
@import "~@blueprintjs/core/lib/css/blueprint.css";
@import "~@blueprintjs/icons/lib/css/blueprint-icons.css";
@import "~design-system-old/build/css/design-system-old.css";
@import "~design-system/build/css/design-system.css";
@import "theme/colors.css";
@import "theme/defaultTheme.css";
@import "theme/wds.css";
@import "assets/fonts/custom/index.css";
@import "assets/fonts/google/index.css";
:root {
/* TODO: This needs to be fixed! This override is to maintain branding changes. */
--ads-color-background-secondary: var(--ads-v2-color-bg-subtle);
/* All on canvas ui need to be above other editor elements
This includes the Modal overlay.
The maximum value of z-index in the theme is 9999.
This value makes sure that on-canvas ui is always above editor elements
*/
--on-canvas-ui-z-index: 999999;
}
body {
margin: 0;
padding: 0;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
background-color: #fff !important;
color: var(--ads-v2-color-fg);
}
body.dragging * {
cursor: grabbing !important;
}
/**
Disable outline completely from all components
*/
:focus,
:focus-visible {
outline: none !important;
outline-offset: 0 !important;
}
/**
Disable outline for adsv2 select component
*/
.ads-v2-select.rc-select-focused {
outline: none !important;
outline-offset: 0 !important;
}
#root.overlay {
opacity: 0;
pointer-events: none;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
}
div.bp3-select-popover .bp3-popover-content {
padding: 0;
}
span.bp3-popover-target {
display: flex;
width: 100%;
}
span.bp3-popover-target > * {
flex-grow: 1;
}
.bp3-popover,
.bp3-popover2 {
box-shadow: var(--ads-v2-shadow-popovers) !important;
}
.bp3-popover2-content {
border-radius: var(--ads-v2-border-radius) !important;
}
.action-selector-popup {
background-color: var(--ads-v2-color-bg);
border-radius: var(--ads-v2-border-radius) !important;
border: 1px solid var(--ads-v2-color-border-muted) !important;
}
.action-selector-popup span.bp3-popover-target > * {
max-width: 100%;
}
add-action.disabled span {
cursor: not-allowed;
}
.action-selector-popup .bp3-button-text {
text-overflow: ellipsis;
overflow: hidden;
min-width: 0;
}
/**
action selector block styles
**/
.bp3-submenu.bp3-popover > .bp3-popover-content {
box-shadow: none;
}
.action-card-border {
border-color: var(--ads-v2-color-border);
}
.action-card-next-selected {
border-bottom: 1px solid var(--ads-v2-color-border-emphasis-plus);
}
.action-card-border-selected {
border-color: var(--ads-v2-color-border-emphasis-plus) !important;
}
.action-card-last-block {
border-radius: 0px 0px var(--ads-v2-border-radius) var(--ads-v2-border-radius);
}
.main-block-radius {
border-radius: var(--ads-v2-border-radius);
}
.main-block-radius-selected {
border-radius: var(--ads-v2-border-radius) var(--ads-v2-border-radius) 0px 0px;
}
.bp3-popover.bp3-minimal.bp3-submenu {
padding-right: 0px;
}
div.bp3-popover-arrow {
display: none;
}
.bp3-button.bp3-loading {
cursor: default !important;
}
.display-none {
display: none;
}
.t--editor-appname-menu-portal {
z-index: 9 !important;
}
.bp3-popover .bp3-input {
outline: 0;
box-shadow: none;
border: 1px solid var(--ads-v2-color-border);
border-radius: var(--ads-v2-border-radius) !important;
}
.bp3-popover .bp3-input:focus {
border-color: var(--ads-v2-color-border-emphasis);
outline: 0;
}
.bp3-popover.bp3-minimal {
margin-top: 8px !important;
}
.bp3-popover.bp3-minimal.action-selector-dropdown {
margin-top: 0px !important;
}
.layout-control.bp3-popover.bp3-minimal {
margin-top: 8px !important;
}
.bp3-popover.none-shadow-popover {
box-shadow: none;
border: 0px;
}
.bp3-datepicker {
border-radius: 0 !important;
}
/* making both the Modal layer and the Dropdown layer */
.bp3-modal-widget,
.appsmith_widget_0 > .bp3-portal {
z-index: 2 !important;
}
/* Portals on the Modal widget */
.bp3-modal-widget .bp3-portal {
z-index: 21 !important;
}
.bp3-popover2-content {
background-color: var(--ads-v2-color-bg) !important;
border-radius: var(--ads-v2-border-radius) !important;
}
.bp3-overlay-backdrop {
background-color: rgba(16, 22, 26, 0.7) !important;
}
.bp3-overlay-zindex {
z-index: 20 !important;
}
/** color picker input control */
.color-picker-input,
.color-picker-input > .bp3-popover-content {
border-radius: var(--ads-v2-border-radius) !important;
}
.color-picker-input {
box-shadow: var(--ads-v2-shadow-popovers) !important;
}
.icon-select-popover,
.icon-select-popover > .bp3-popover-content {
border-radius: var(--ads-v2-border-radius) !important;
}
.icon-select-popover {
box-shadow: var(--ads-v2-shadow-popovers) !important;
}
.error-menuitem {
color: var(--ads-v2-color-fg-error) !important;
}
.error-menuitem > .ads-v2-menu__menu-item-children {
color: var(--ads-v2-color-fg-error) !important;
}
.error-menuitem:hover:not([data-disabled]),
.error-menuitem:focus-visible {
background-color: var(--ads-v2-color-red-50) !important;
}
.error-menuitem:active:not([data-disabled]) {
background-color: var(--ads-v2-color-red-100) !important;
}
.menuitem-nohover:hover {
background-color: transparent !important;
cursor: default !important;
}
.react-datepicker__children-container {
margin-top: -10px !important;
}
.reconnect-datasource-modal {
z-index: 9 !important;
}
/** Conditional vertical margin applied to widgets.
If in a row of widgets (.aligned-widget-row), one of the widgets has a label ([data-field-label-wrapper]), then
all widgets (.anvil-widget-wrapper) in the row other than the widget with the label, will shift down using the
margin-block-start property. This is to ensure that the widgets are aligned vertically.
The value of the margin-block-start property is calculated based on the spacing tokens used by the labels in input like components
*/
.aligned-widget-row:has(.anvil-widget-wrapper [data-field-label-wrapper])
.anvil-widget-wrapper:not(:has([data-field-label-wrapper])) {
margin-block-start: calc(var(--inner-spacing-3) + var(--sizing-3));
}
/** Asymmetric Padding
If a section (has div[data-elevation="false"][elevation="1"]) does not have elevation,
then the padding is set to 0.
elevation="1" is used to denote that the section has elevation.
*/
div.anvil-widget-wrapper:has(div[data-elevation="false"][elevation="1"]) {
padding: var(--outer-spacing-0);
}
/** Asymmetric Padding
If none of the zones (has div[data-elevation="false"][elevation="2"]) in a section have elevation,
then the vertical padding is set to 0 for all zones.
elevation="2" is used to denote that the zone has elevation.
Note: we've used `div.anvil-widget-wrapper:has(div[data-elevation])` to select all zones
because today, we don't have nested sections. So, any widget that has `data-elevation` in another widget that has `data-elevation`
will be a zone.
*/
div.anvil-widget-wrapper:not(:has(div[data-elevation="true"][elevation="2"]))
div.anvil-widget-wrapper:has(div[data-elevation]) {
padding-block: var(--outer-spacing-0);
}