Skip to content
Snippets Groups Projects

Main

Closed Eryk Mika requested to merge main into just_for_review
All threads resolved!
1 file
+ 6
0
Compare changes
  • Side-by-side
  • Inline
@@ -4,7 +4,13 @@ import {useState} from "react";
@@ -4,7 +4,13 @@ import {useState} from "react";
export default function NumberWithUnit({label, onChange, value, className}) {
export default function NumberWithUnit({label, onChange, value, className}) {
const splitValues = function (fontSize) {
const splitValues = function (fontSize) {
 
 
if( !fontSize ) {
 
return {size: "0", unit: "px"};
 
}
 
const match = fontSize.match(/^(\d+)([a-z%]+)$/i);
const match = fontSize.match(/^(\d+)([a-z%]+)$/i);
 
if (!match) {
if (!match) {
return {size: "16", unit: "px"};
return {size: "16", unit: "px"};
}
}
Loading