File tree Expand file tree Collapse file tree 1 file changed +26
-3
lines changed
Expand file tree Collapse file tree 1 file changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,22 @@ functions.bold = function (s) {
106106} ;
107107
108108functions . center = function ( s ) {
109- this . style += "text-align: center;" ;
109+ const e = this . element ;
110+ this . element = Object . assign ( document . createElement ( "div" ) , {
111+ style : `
112+ display: flex;
113+ flex-direction: column;
114+ flex-wrap: nowrap;
115+ justify-content: center;
116+ align-items: center;
117+ text-align: center;
118+ width: 100%;
119+ height: 100%;
120+ min-width: 0;
121+ min-height: 0;
122+ ` ,
123+ } ) ;
124+ this . element . appendChild ( e ?? document . createTextNode ( s ) ) ;
110125 return s ;
111126} ;
112127
@@ -133,9 +148,16 @@ functions.checkbox = function (label) {
133148 value = ! ! previous ;
134149 return ! ! previous ;
135150 } ) ;
151+ const e = this . element ;
136152 this . element = Object . assign ( document . createElement ( "label" ) , {
137- innerText : label ,
138- style : "display: flex; align-items: center; gap: 1ch; margin: 0 0.5em;" ,
153+ style : `
154+ display: flex;
155+ justify-content: center;
156+ align-items: center;
157+ gap: 1ch;
158+ margin: 0 0.5em;
159+ width: 100%;
160+ ` ,
139161 } ) ;
140162 this . element . appendChild (
141163 Object . assign ( document . createElement ( "input" ) , {
@@ -145,5 +167,6 @@ functions.checkbox = function (label) {
145167 oninput : ( e ) => this . set ( e . target . checked ) ,
146168 } ) ,
147169 ) ;
170+ this . element . appendChild ( e ?? document . createTextNode ( label ) ) ;
148171 return value ;
149172} ;
You can’t perform that action at this time.
0 commit comments