Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import or require. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              .mui-content-container
    .mui-row
        .mui-column.-s12.-m8.-m-offset-2.-l6.-l-offset-3
            // Card
            .mui-card._shadow-1._separate-1
                .header.-blue-3-bg
                    h5 Lorem ipsum
                .content.-white-bg
                
                    // Username
                    .mui-input-wrapper
                        label.mui-input-label Username
                        .mui-input-hint
                            span Username (min 3 characters, only letters allowed)
                            span.mui-input-indicator
                                span.validicon
                                    svg.mui-svg-icon
                                        use(xlink:href='#mui-svg-icon--check')
                                span.invalidicon
                                    svg.mui-svg-icon
                                        use(xlink:href='#mui-svg-icon--close')
                        .mui-input#example-username(data-regexp='^[a-zA-Z]{3,}$' data-validation-delay='1000')
                            input(type='text' placeholder='Your username')

                    // Password
                    .mui-input-wrapper._separate-1
                        label.mui-input-label Password
                        .mui-input-hint
                            span We recommend to use 12 characters or more
                            span.mui-input-indicator
                                span.validicon
                                    svg.mui-svg-icon
                                        use(xlink:href='#mui-svg-icon--check')
                                span.invalidicon
                                    svg.mui-svg-icon
                                        use(xlink:href='#mui-svg-icon--close')
                        .mui-input#example-password(data-regexp='^.{12,}$' data-validation-delay='1000')
                            input(type='password' placeholder='Your password')

                    // Checkboxes
                    ._separate-top-2
                        .mui-checkbox#example-checkbox-1
                            input(type='checkbox')
                            label
                                span.icon
                                    span.symbol
                                        svg.mui-svg-icon
                                            use(xlink:href='#mui-svg-icon--check')
                                span.text Subscribe lorem, ipsum dolor
                        .mui-checkbox._separate-1#example-checkbox-2
                            input(type='checkbox')
                            label
                                span.icon
                                    span.symbol
                                        svg.mui-svg-icon
                                            use(xlink:href='#mui-svg-icon--check')
                                span.text Send me lorem ipsum dolor

                    // Next button
                    ._separate-top-2._text-right
                        button.mui-button.-blue-3-bg.-f-blue-4-bg#example-next-button
                            span next
                            svg.mui-svg-icon
                                use(xlink:href='#mui-svg-icon--arrow-right')


// Icons
.mui-svg-sprite
    svg(version='1.1', xmlns='http://www.w3.org/2000/svg')
        symbol#mui-svg-icon--check(viewBox='0 0 512 512')
            path(d='M186.301 339.893L96 249.461l-32 30.507L186.301 402 448 140.506 416 110z')
        symbol#mui-svg-icon--close(viewBox='0 0 512 512')
            path(d='M405 136.798L375.202 107 256 226.202 136.798 107 107 136.798 226.202 256 107 375.202 136.798 405 256 285.798 375.202 405 405 375.202 285.798 256z')
        symbol#mui-svg-icon--arrow-right(viewBox='0 0 512 512')
            path(d='M85 277.375h259.704L225.002 397.077 256 427l171-171L256 85l-29.922 29.924 118.626 119.701H85v42.75z')

            
          
!
            
              document.addEventListener('DOMContentLoaded', () => {
    // "Get" returns previously created Muilessium components.
    // We specify the components type and the ID of the html element.
    const username  = Muilessium.get('Input',    'example-username');
    const password  = Muilessium.get('Input',    'example-password');
    const checkbox1 = Muilessium.get('Checkbox', 'example-checkbox-1');
    const checkbox2 = Muilessium.get('Checkbox', 'example-checkbox-2');
    const button    = Muilessium.get('Button',   'example-next-button');

    // Some components have events...
    button.addEventListener('click', () => {
        // Some components have methods...
        // NOTE: Inputs have the "data-regexp" attribute.
        // They use this regexp in the "validate" method.
        username.validate();
        password.validate();
        
        if (username.isValid() && password.isValid()) {
            const data = {
                username:  username.getValue(),
                password:  password.getValue(),
                checkbox1: checkbox1.getState(),
                checkbox2: checkbox2.getState()
            };

            console.log(data);
        }
    });
});
            
          
!
999px

Console