fune/devtools/client/inspector/changes/components/CSSDeclaration.js
Razvan Caliman 051fe82571 Bug 1613960 - Remove artificial text indent from CSS declarations in Changes panel. r=pbro
For people who want to copy the plain text CSS declarations in the Changes panel, we prevent including the +/- diff signs in the selection. We did preserve the text indent. This patch removes the text indent as well.

Differential Revision: https://phabricator.services.mozilla.com/D62052

--HG--
extra : moz-landing-system : lando
2020-02-10 09:31:32 +00:00

45 lines
1.1 KiB
JavaScript

/* 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/. */
"use strict";
const { PureComponent } = require("devtools/client/shared/vendor/react");
const dom = require("devtools/client/shared/vendor/react-dom-factories");
const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
class CSSDeclaration extends PureComponent {
static get propTypes() {
return {
className: PropTypes.string,
property: PropTypes.string.isRequired,
value: PropTypes.string.isRequired,
};
}
static get defaultProps() {
return {
className: "",
};
}
render() {
const { className, property, value } = this.props;
return dom.div(
{ className: `changes__declaration ${className}` },
dom.span(
{ className: "changes__declaration-name theme-fg-color3" },
property
),
": ",
dom.span(
{ className: "changes__declaration-value theme-fg-color1" },
value
),
";"
);
}
}
module.exports = CSSDeclaration;