Files
firefox/devtools/client/themes/layout.css
T
Patrick Brosset e72105f5d4 Bug 1359759 - 2 - Clear React warnings in GridOutline and prevent re-renders; r=gl
Made the GridOutline component work with only 1 grid at a time.
It already did, but in a not so obvious way.

Removed the setState that happened during the render call to avoid
React warnings.

Cleaned up various data attribute to use the dataset property instead.

Removed the mouseover/out that controled the background color of the
highlighted cells. This now happens in CSS :hover, using currentColor.

Avoided React warnings related to missing "key" props.

Made changes to grid-inspector to avoid loops of re-renders when the
highlighter would highlight a cell on hover.
The component would wait for highlighter's events to dispatch store
actions. Instead, we dispatch them first, then when the events come, we
check if things have really changed! This way, the events will still have
effect if they come from the rule-view for instance, but not if they
come from the grid outline itself.

MozReview-Commit-ID: 6LK8B1P8iMU
2017-05-10 16:07:12 +02:00

151 lines
2.0 KiB
CSS

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#layout-container {
height: 100%;
width: 100%;
overflow: auto;
min-width: 200px;
}
/**
* Common styles for shared components
*/
.grid-container {
display: flex;
flex-direction: column;
flex: 1 auto;
align-items: center;
min-width: 140px;
}
.grid-container > span {
font-weight: 600;
margin-bottom: 5px;
pointer-events: none;
}
.grid-container > ul {
list-style: none;
margin: 0;
padding: 0;
}
.grid-container li {
display: flex;
align-items: center;
padding: 4px 0;
}
.grid-container input {
margin: 0 5px;
}
.grid-container label {
display: flex;
align-items: center;
}
/**
* Grid Container
*/
#layout-grid-container {
display: flex;
flex-direction: column;
margin: 5px;
}
/**
* Grid Outline
*/
.grid-outline {
margin-top: 10px;
overflow: visible;
}
/**
* Grid Content
*/
.grid-content {
display: flex;
flex-wrap: wrap;
flex: 1;
margin-top: 10px;
}
.grid-container:first-child {
margin-bottom: 10px;
}
/**
* Grid Outline
*/
#grid-outline {
margin: 5px auto;
}
.grid-outline-border {
fill: none;
stroke: currentColor;
stroke-width: 0.75;
vector-effect: non-scaling-stroke;
}
.grid-outline-cell {
pointer-events: all;
stroke: currentColor;
stroke-dasharray: 0.5, 2;
vector-effect: non-scaling-stroke;
}
.grid-outline-cell:hover {
opacity: 0.45;
fill: currentColor;
}
.grid-outline-line {
opacity: 0;
stroke-width: 10;
}
/**
* Container when no grids are present
*/
.layout-no-grids {
font-style: italic;
text-align: center;
padding: 0.5em;
}
/**
* Grid Item
*/
.grid-color-swatch {
width: 12px;
height: 12px;
margin-left: 5px;
border: 1px solid var(--theme-highlight-gray);
border-radius: 50%;
cursor: pointer;
}
.grid-color-value {
display: none;
}
/**
* Settings Item
*/
.grid-settings-item label {
line-height: 16px;
}