Skip to content

Commit

Permalink
perf(Root): Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
eanorambuena committed May 19, 2024
1 parent 1a22039 commit 14c433b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 106 deletions.
3 changes: 1 addition & 2 deletions dist/react-style-object-to-css/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
'use strict'

import { isUnitlessNumber } from './lib/CSSProperty'
import isUnitlessNumber from './lib/CSSProperty'
import hyphenateStyleName from './lib/hyphenateStyleName'

var isArray = Array.isArray
var keys = Object.keys

var counter = 1
// Follows syntax at https://developer.mozilla.org/en-US/docs/Web/CSS/content,
// including multiple space separated values.
var unquotedContentValueRegex = /^(normal|none|(\b(url\([^)]*\)|chapter_counter|attr\([^)]*\)|(no-)?(open|close)-quote|inherit)((\b\s*)|$|\s+))+)$/
Expand Down
53 changes: 2 additions & 51 deletions dist/react-style-object-to-css/lib/CSSProperty.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* CSS properties which accept numbers but are not in units of "px".
*/
export var isUnitlessNumber = {
var isUnitlessNumber = {
boxFlex: true,
boxFlexGroup: true,
columnCount: true,
Expand Down Expand Up @@ -53,53 +53,4 @@ Object.keys(isUnitlessNumber).forEach(function(prop) {
})
})

/**
* Most style properties can be unset by doing .style[prop] = '' but IE8
* doesn't like doing that with shorthand properties so for the properties that
* IE8 breaks on, which are listed here, we instead unset each of the
* individual properties. See http://bugs.jquery.com/ticket/12385.
* The 4-value 'clock' properties like margin, padding, border-width seem to
* behave without any problems. Curiously, list-style works too without any
* special prodding.
*/
export var shorthandPropertyExpansions = {
background: {
backgroundImage: true,
backgroundPosition: true,
backgroundRepeat: true,
backgroundColor: true
},
border: {
borderWidth: true,
borderStyle: true,
borderColor: true
},
borderBottom: {
borderBottomWidth: true,
borderBottomStyle: true,
borderBottomColor: true
},
borderLeft: {
borderLeftWidth: true,
borderLeftStyle: true,
borderLeftColor: true
},
borderRight: {
borderRightWidth: true,
borderRightStyle: true,
borderRightColor: true
},
borderTop: {
borderTopWidth: true,
borderTopStyle: true,
borderTopColor: true
},
font: {
fontStyle: true,
fontVariant: true,
fontWeight: true,
fontSize: true,
lineHeight: true,
fontFamily: true
}
}
export default isUnitlessNumber
3 changes: 1 addition & 2 deletions src/react-style-object-to-css/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
'use strict'

import { isUnitlessNumber } from './lib/CSSProperty'
import isUnitlessNumber from './lib/CSSProperty'
import hyphenateStyleName from './lib/hyphenateStyleName'

var isArray = Array.isArray
var keys = Object.keys

var counter = 1
// Follows syntax at https://developer.mozilla.org/en-US/docs/Web/CSS/content,
// including multiple space separated values.
var unquotedContentValueRegex = /^(normal|none|(\b(url\([^)]*\)|chapter_counter|attr\([^)]*\)|(no-)?(open|close)-quote|inherit)((\b\s*)|$|\s+))+)$/
Expand Down
53 changes: 2 additions & 51 deletions src/react-style-object-to-css/lib/CSSProperty.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* CSS properties which accept numbers but are not in units of "px".
*/
export var isUnitlessNumber = {
var isUnitlessNumber = {
boxFlex: true,
boxFlexGroup: true,
columnCount: true,
Expand Down Expand Up @@ -53,53 +53,4 @@ Object.keys(isUnitlessNumber).forEach(function(prop) {
})
})

/**
* Most style properties can be unset by doing .style[prop] = '' but IE8
* doesn't like doing that with shorthand properties so for the properties that
* IE8 breaks on, which are listed here, we instead unset each of the
* individual properties. See http://bugs.jquery.com/ticket/12385.
* The 4-value 'clock' properties like margin, padding, border-width seem to
* behave without any problems. Curiously, list-style works too without any
* special prodding.
*/
export var shorthandPropertyExpansions = {
background: {
backgroundImage: true,
backgroundPosition: true,
backgroundRepeat: true,
backgroundColor: true
},
border: {
borderWidth: true,
borderStyle: true,
borderColor: true
},
borderBottom: {
borderBottomWidth: true,
borderBottomStyle: true,
borderBottomColor: true
},
borderLeft: {
borderLeftWidth: true,
borderLeftStyle: true,
borderLeftColor: true
},
borderRight: {
borderRightWidth: true,
borderRightStyle: true,
borderRightColor: true
},
borderTop: {
borderTopWidth: true,
borderTopStyle: true,
borderTopColor: true
},
font: {
fontStyle: true,
fontVariant: true,
fontWeight: true,
fontSize: true,
lineHeight: true,
fontFamily: true
}
}
export default isUnitlessNumber

0 comments on commit 14c433b

Please sign in to comment.