Skip to content
This repository was archived by the owner on Feb 9, 2023. It is now read-only.

Remove hardcoded transform from float to cssFloat #172

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions object-stringifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ class ObjectStringifier extends Stringifier {
decl(node, semicolon) {
let prop = this.rawValue(node, 'prop');

if (prop === 'float') {
prop = 'cssFloat';
}

let string = prop;

const isObjectShorthand = node.raws.node && node.raws.node.shorthand;
Expand Down
29 changes: 16 additions & 13 deletions test/css-in-js.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ describe('CSS in JS', () => {
`);
});

it('float', () => {
it('cssFloat', () => {
const code = `
import glm from 'glamorous';
const Component1 = glm.a({
Expand All @@ -148,21 +148,24 @@ describe('CSS in JS', () => {
cssFloat: "left",
});
`);
});

root.first.first.nodes = [
postcss.decl({
prop: 'float',
value: 'right',
raws: {
before: root.first.first.first.raws.before,
},
}),
];
it('float', () => {
const code = `
const component = styled(Btn)({
float: "left",
});
`;

const root = syntax.parse(code, {
from: '/fixtures/styled-float.jsx',
});

expect(root.first.first.first).toHaveProperty('prop', 'float');

expect(root.toString()).toBe(`
import glm from 'glamorous';
const Component1 = glm.a({
cssFloat: "right",
const component = styled(Btn)({
float: "left",
});
`);
});
Expand Down