多个代号一个 CSS

Fra*_*ani 5 codenameone

是否可以在同一个 Codename One 项目中使用更多 CSS?

用例 1:我想在应用程序的不同部分使用不同的样式,或者我想完全替换当前的样式。

用例 2:我希望当前样式源自多个 CSS,例如在网页中

Sha*_*mog 3

There is currently no support for that in the CSS implementation that's integrated into the plugin. The old implementation allowed that but we simplified some things so the conversion process will be fluid.

Since multiple resource files and layered themes are supported internally by Codename One this should probably be easy to accomplish. I'm guessing something like this in the build.xml might work:

<target name="-cn1-compile-css" if="codename1.cssTheme">
        <java jar="${user.home}/.codenameone/designer_1.jar" failonerror="true">
            <jvmarg value="-Dcli=true"/>
            <arg value="-css"/>
            <arg file="css/theme.css"/>
            <arg file="src/theme.res"/>
        </java>
        <java jar="${user.home}/.codenameone/designer_1.jar" failonerror="true">
            <jvmarg value="-Dcli=true"/>
            <arg value="-css"/>
            <arg file="css/second-theme.css"/>
            <arg file="src/second-theme.res"/>
        </java>
    </target>
</project>
Run Code Online (Sandbox Code Playgroud)