Capitalize float and margin CSS property names
186040
def capitalize_float_margin(css_body):
    

    def _capitalize_property(match):
        return "{0}:{1}{2}".format(
            match.group("property").capitalize(),
            match.group("value"),
            match.group("terminator"),
        )

    return _lowercase_margin_float_rule.sub(_capitalize_property, css_body)
660543
function( element, property )
    {
        var styles = window.getComputedStyle( element, null );

        if ( styles ) {
          // element.style[..] is undefined for browser specific styles
          // as 'filter'.
          return styles[ property ] || styles.getPropertyValue( property ) || '';
        }
        return "";
    }
82453
function similarPropertyNames(property) {
		if (typeof property !== 'string') {
			property = property.name();
		}

		var similarProps = (cssResolver.vendorPrefixes(property) || []).map(function(prefix) {
			return '-' + prefix + '-' + property;
		});
		similarProps.push(property);
		return similarProps;
	}
1287420
function (input) {
            var ellipsisContainer = input.previousSibling, elementoffsetWidth = ellipsisContainer.offsetWidth, frameWidth = this._frame.innerWidth;
            // 10 is to consider margin and padding
            if (elementoffsetWidth >= (frameWidth - 10)) {
                ellipsisContainer.firstChild.className += " ellipsisClass";
                var elementWidth = frameWidth - ellipsisContainer.offsetLeft
                        - (ellipsisContainer.firstChild.offsetLeft + ellipsisContainer.lastChild.offsetWidth) * 2;
                ellipsisContainer.firstChild.style.maxWidth = elementWidth + "px";
            }

        }
625968
public String getPropertyName(String name) {

        if ("float".equals(name)) {
            return "cssFloat";
        } else if ("class".equals(name)) {
            return "className";
        } else if ("for".equals(name)) {
            return "htmlFor";
        }
        return camelize(name);
    }
1108347
private String sanitizeCssPropertyName(final String propertyName) {
    if (!propertyName.contains("-")) {
      return propertyName;
    } else {
      String sanitized = propertyName;
      int index = sanitized.indexOf('-');
      while (index != -1) {
        String charToBeReplaced = sanitized.substring(index + 1, index + 2);
        String replacement = charToBeReplaced.toUpperCase();
        sanitized = sanitized.replaceAll("-" + charToBeReplaced, replacement);
        index = sanitized.indexOf('-');
      }
      return sanitized;
    }
  }
900313
function (name) {
            var cssStyle = this.getAttr('style');
            if (!cssStyle) {
                return ''
            }
            var reg = new RegExp('(^|;)\\s*' + name + ':([^;]+)','i');
            var match = cssStyle.match(reg);
            if (match && match[0]) {
                return match[2]
            }
            return '';
        }
355746
function(property) {
            var memo = {};

            $.getCssPropertyWithVendorPrefix = function(property) {
                if (memo[property] !== undefined) {
                    return memo[property];
                }
                var style = document.createElement('div').style;
                var result = null;
                if (style[property] !== undefined) {
                    result = property;
                } else {
                    var prefixes = ['Webkit', 'Moz', 'MS', 'O',
                        'webkit', 'moz', 'ms', 'o'];
                    var suffix = $.capitalizeFirstLetter(property);
                    for (var i = 0; i < prefixes.length; i++) {
                        var prop = prefixes[i] + suffix;
                        if (style[prop] !== undefined) {
                            result = prop;
                            break;
                        }
                    }
                }
                memo[property] = result;
                return result;
            };
            return $.getCssPropertyWithVendorPrefix(property);
        }
900123
def caution_title_header_element(feature, parent):
    """"""
    _ = feature, parent  # NOQA
    header = caution_title_header['string_format']
    return header.capitalize()
1028396
function prependTitle(html, title, svgWidth) {
        if (!title || !svgWidth) {
            return html;
        }
        let {grey} = colorSchemas;

        html =  html.replace(/<g/,`<text x="${this.margin().left}" y="${config.titleTopOffset}" font-family="${config.titleFontFamily}" font-size="${config.titleFontSize}" fill="${grey[6]}"> ${title} </text><g `);

        return html;
    }
438661
function resolvePropertyName(name, syntax) {
		var snippet = resources.findSnippet(syntax, name);
		
		if (!snippet && prefs.get('css.fuzzySearch')) {
			var minScore = parseFloat(prefs.get('css.fuzzySearchMinScore'));
			snippet = resources.fuzzyFindSnippet(syntax, name, minScore);
		}
		
		if (snippet) {
			if (typeof snippet !== 'string') {
				snippet = snippet.data;
			}
			
			return cssResolver.splitSnippet(snippet).name;
		}
	}
1226400
function buildClassNamePropFunction(t, cssObject, keyAliases) {
    var objectProperties =
        Object.keys(cssObject).map(key => {
            var value = cssObject[key]

            if (!isNaN(key)) {
                key = `@media screen and (min-width: ${key}px)`
            }
            else if (key in keyAliases) {
                key = keyAliases[key]
            }

            return t.objectProperty(
                    t.identifier(key),
                    value,
                )
            }
        )

    return t.jSXAttribute(
        t.jSXIdentifier('className'),
        t.jSXExpressionContainer(
            t.callExpression(
                t.identifier('css'),
                [
                    t.objectExpression(objectProperties)
                ]
            )
        )
    )
}
774188
function propertyNameToAttribute(propertyName) {
  let attribute = propertyNamesToAttributes[propertyName];
  if (!attribute) {
    // Convert and memoize.
    const uppercaseRegEx = /([A-Z])/g;
    attribute = propertyName.replace(uppercaseRegEx, '-$1').toLowerCase();
  }
  return attribute;
}
997319
function() {
        var style = this._element.style,
            coord = this.__coord || [0, 0, 0, 0],
            co = {
                x: coord[0],
                y: coord[1],
                w: coord[2],
                h: coord[3]
            },
            prefix = Crafty.support.prefix,
            trans = [];

        if (this._cssStyles.visibility !== this._visible) {
            this._cssStyles.visibility = this._visible;
            if (!this._visible) {
                style.visibility = "hidden";
            } else {
                style.visibility = "visible";
            }
        }

        //utilize CSS3 if supported
        if (Crafty.support.css3dtransform && !this.avoidCss3dTransforms) {
            trans.push(
                "translate3d(" + ~~this._x + "px," + ~~this._y + "px,0)"
            );
        } else {
            if (this._cssStyles.left !== this._x) {
                this._cssStyles.left = this._x;
                style.left = ~~this._x + "px";
            }
            if (this._cssStyles.top !== this._y) {
                this._cssStyles.top = this._y;
                style.top = ~~this._y + "px";
            }
        }

        if (this._cssStyles.width !== this._w) {
            this._cssStyles.width = this._w;
            style.width = ~~this._w + "px";
        }
        if (this._cssStyles.height !== this._h) {
            this._cssStyles.height = this._h;
            style.height = ~~this._h + "px";
        }
        if (this._cssStyles.zIndex !== this._z) {
            this._cssStyles.zIndex = this._z;
            style.zIndex = this._z;
        }

        if (this._cssStyles.opacity !== this._alpha) {
            this._cssStyles.opacity = this._alpha;
            style.opacity = this._alpha;
            style[prefix + "Opacity"] = this._alpha;
        }

        if (this._mbr) {
            var origin = this._origin.x + "px " + this._origin.y + "px";
            style.transformOrigin = origin;
            style[prefix + "TransformOrigin"] = origin;
            if (Crafty.support.css3dtransform)
                trans.push("rotateZ(" + this._rotation + "deg)");
            else trans.push("rotate(" + this._rotation + "deg)");
        }

        if (this._flipX) {
            trans.push("scaleX(-1)");
        }

        if (this._flipY) {
            trans.push("scaleY(-1)");
        }

        if (this._cssStyles.transform !== trans.join(" ")) {
            this._cssStyles.transform = trans.join(" ");
            style.transform = this._cssStyles.transform;
            style[prefix + "Transform"] = this._cssStyles.transform;
        }

        this.trigger("Draw", {
            style: style,
            type: "DOM",
            co: co
        });

        return this;
    }
322909
function(items) {
            for(var i = 0; i < items.length; i++) {
                var heightToAdd = 0;
                if(!isNaN(items[i].relativeHeight)) {
                    var height = items[i].element[0].getBoundingClientRect().height;
                    heightToAdd = items[i].relativeHeight - height;
                    var marginBottom = parseInt(items[i].element.css('margin-bottom')) + (heightToAdd > 0 ? heightToAdd : 0);
                    items[i].element.css('margin-bottom', marginBottom + 'px');
                }
            }
        }
1049651
function getPaddings(styles) {
    const positions = ['top', 'right', 'bottom', 'left'];
    const paddings = {};

    for (const position of positions) {
        const value = styles['padding-' + position];

        paddings[position] = toFloat(value);
    }

    return paddings;
}
1188159
function capitalize(value) {
  var result = []
  var index = -1
  var length = value.length

  while (++index < length) {
    result[index] = value[index].charAt(0).toUpperCase() + value[index].slice(1)
  }

  return result
}