apache / royale-compiler

Apache Royale Compiler
https://royale.apache.org/
Apache License 2.0
95 stars 49 forks source link

HTML CSS selectors converted to class selectors #20

Open Harbs opened 6 years ago

Harbs commented 6 years ago

The following MXML:

    <fx:Style>
        @namespace "http://www.w3.org/1999/xhtml";
        div{

        }
        h1{font-size: 32px; margin: .67em 0 }
        h2{font-size: 24px; margin: .75em 0 }
        h3{font-size: 19px; margin: .83em 0 }
        h4{font-size: 16px; margin: .1em 0 }
        h5{font-size: 14px; margin: 1.5em 0 }
        h6{font-size: 13px; margin: 1.67em 0 }
        h1, h2, h3, h4, h5, h6{
            font-weight: bolder;
        }

Is output as the following css:

.div {
}

.h1 {
        margin: .67em 0;
        font-size: 32px;
        font-weight: bolder;
}

.h2 {
        margin: .75em 0;
        font-size: 24px;
        font-weight: bolder;
}

.h3 {
        margin: .83em 0;
        font-size: 19px;
        font-weight: bolder;
}

.h4 {
        margin: .1em 0;
        font-size: 16px;
        font-weight: bolder;
}

.h5 {
        margin: 1.5em 0;
        font-size: 14px;
        font-weight: bolder;
}

.h6 {
        margin: 1.67em 0;
        font-size: 13px;
        font-weight: bolder;
}

The selectors should pass through as-is and not have the dot appended.

aharui commented 6 years ago

In JSCSSCompilationSession.java, try filling out the htmlElementNames array.