Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A0499200BDD for ; Sat, 10 Dec 2016 17:13:45 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 9EC41160B2B; Sat, 10 Dec 2016 16:13:45 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 989FE160B1C for ; Sat, 10 Dec 2016 17:13:44 +0100 (CET) Received: (qmail 34189 invoked by uid 500); 10 Dec 2016 16:13:43 -0000 Mailing-List: contact dev-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list dev@flex.apache.org Received: (qmail 34146 invoked by uid 99); 10 Dec 2016 16:13:43 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 10 Dec 2016 16:13:43 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id E7DAF180A48 for ; Sat, 10 Dec 2016 16:13:42 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.899 X-Spam-Level: ** X-Spam-Status: No, score=2.899 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_REPLY=1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id r-ZXMeJafyry for ; Sat, 10 Dec 2016 16:13:38 +0000 (UTC) Received: from mail-io0-f175.google.com (mail-io0-f175.google.com [209.85.223.175]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id CEF8A5F250 for ; Sat, 10 Dec 2016 16:13:37 +0000 (UTC) Received: by mail-io0-f175.google.com with SMTP id h30so106740674iod.2 for ; Sat, 10 Dec 2016 08:13:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=ULYZqsphT35DF5rJpNatrYLg/OACUVkMq6REuSS4Itw=; b=N+OaAQfBJEquV6WRGyXSp+F3G1rCQodEVZePhewEF2Qai/yjrNvEAyXinhkzCm9at/ KMSSfO5ul6NY5AncEFKiguMXqfhYhb8yrj+xZ+1wSW1I5IlOi/HBmIlbxG2vAidCuPuK e+RMhybAxFOKrAAkrIkmkHk+uenUkHEPOGJCjucbFnbzRS+Vp/rOU8rErHXn8eoi8F/A MOUVsP6I0vMqEadcMeyt+0fd/6tFoflMgVFI9qurKeMGf4lVweRdi2Uy5n8vQRmVJBVW X6ggUv3EJK5fROU/JRI0aEjJG59dxEI2ikS/pSZo8i6w5Np4lPMu4ly+/MqlrGEU8w4u uUxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=ULYZqsphT35DF5rJpNatrYLg/OACUVkMq6REuSS4Itw=; b=cu4RlSJzP3xwFB1pcweDxKwINGyZ1cb2RkF9917dHlHWLBEXxAaq+PTzB9APvhQw46 KWpyXnJXl9VfD7LiDIlkGX5+pjecSoMAYbGf77el2ZCohAgDp9c7n7zbHr/5l6VKR6Wp m/LRorzYdeTYnK/OPBnRFRlKyG3EkcuUoxy0b1rglIyEQioc9HAmje742S4mvX2N6jdJ gY5Yq3q+MldwLmEr4YL98zlH64EAoLQK+7cXKST9bNsjljMFlIaZmIViRAoCV01IUzvJ ouWoNh6O2F40OPx/tbOuLQe1hSVWKNy6xiSK7PHmkyOKCUvmXz0X7GwDNToFPVVxcMbc RVYQ== X-Gm-Message-State: AKaTC00/5RZySIenIpoIxZ0GWRnRiA6FSvOacBo34yYjkHOaj5crhWkAxNdBgzjNFbj/gXqGjGPUjpwN/Ziz2A== X-Received: by 10.36.139.197 with SMTP id g188mr11794358ite.68.1481386415444; Sat, 10 Dec 2016 08:13:35 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.26.76 with HTTP; Sat, 10 Dec 2016 08:13:34 -0800 (PST) Received: by 10.107.26.76 with HTTP; Sat, 10 Dec 2016 08:13:34 -0800 (PST) In-Reply-To: References: From: flex capacitor Date: Sat, 10 Dec 2016 10:13:34 -0600 Message-ID: Subject: Re: [FlexJS] get rid of inline styles (was Re: [FlexJS]Layout problems) To: dev Content-Type: multipart/alternative; boundary=94eb2c04b9181158b2054350273f archived-at: Sat, 10 Dec 2016 16:13:45 -0000 --94eb2c04b9181158b2054350273f Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable In Radiate I convert Flex UIComponents to HTML components and had this problem. I made an option to allow styles to be defined inline or in a style sheet. If the option was stylesheet then if the component had an id the styles were declared by id. This included position, size, etc: #myLabel { style: value; } If the component didn't have an id too bad. I'd give it an id using Flex naming utils class and again declare styles there. But I added an option to let developers override the styles per component and that might work here. So you would have a components style declaration by id and then in Radiate there is a user styles field. Any values in that field would be declared in the style declaration but they would be placed at the end. Everybody knows that last declaration wins, even grandma. #myLabel { style: value; /*define by framework */ style: newValue; /* defined by user */ } You could also declare style: inherit and I think that resets the value. Yes, the style is declared twice. Who cares. But yes to look pretty, I plan to remove the first declaration or comment it out in a future update. If Flex JS made some combination of class and class#id it might be an option so that you can declare your own style declaration afterwards and restore the defaults. Yes there might be two style declarations but at least then they wouldn't be defined inline. On Dec 2, 2016 11:52 AM, "Carlos Rovira" wrote: > Hi Josh, > > right. As I get some few components more, I think I could refactor removi= ng > the dependencies from some HTML comps so we could manage better MDL set. = So > for example, I will took things from Core, like UIBase or ContainerBase > while removing html things like TextButton, Container and so on...(in the > end removing HTML.swc dependency at all). In this way I think MDL will be > more independent. > > 2016-12-02 16:55 GMT+01:00 Josh Tynjala : > > > Alex's first point about using the same beads, but not subclassing soun= ds > > cleaner to me, Carlos. Kind of the same idea from the other day where a= ll > > components should be possible to recreate from UIBase with the right se= t > of > > beads. You should consider trying that out for MDL. > > > > - Josh > > > > On Dec 1, 2016 11:09 PM, "Alex Harui" wrote: > > > > > Re-ordering your post so I can address higher-level points first: > > > > > > > > > On 12/1/16, 4:55 PM, "carlos.rovira@gmail.com on behalf of Carlos > > Rovira" > > > wrote: > > > > > > > >But Basic set is at the core of > > > >all. Is at the core of MDL set > > > > > > > > > > > > > > This statement doesn't have to be true, and makes me think that the o= ld > > > Flex SDK mentality is persisting. IMO, the MDL set has no obligation > to > > > subclass the Basic set. The top-level components in the Basic set ar= e > > > supposed to be compositions of beads. MDL can just compose the same = or > > > different beads without having to subclass Basic components. > > > > > > One of the problems of having a core and inheritance is that you have > to > > > get it right, but often there isn't one right answer. > > > > > > >I think > > > >Basic set (as is) will not be used at all since the final visuals ar= e > > not > > > >production ready, so you know people will need this level of > > customization > > > >or they will never join FleJS for sure. and here you have the first > > > >example of many > > > >of the styles in flexjs needs to be removed in order to get the MDL > > branch > > > >working ok, and so will happen with others like Bootstrap, and so > on... > > > >Only if we create our own FlexJS style design could take into accoun= t > > the > > > >actual styles, but I think that if MDL or Bootstrap does not need al= l > of > > > >that, we should not need creating our own CSS set in the end (I can'= t > > say > > > >much more here since I'm not a CSS expert to affirm that, but based = on > > > >what > > > >I see...is clear that it's the reality). > > > > > > > > > > In my mind, there are going to be two kinds of themes: pre-existing > ones > > > like MDL and custom ones like the themes that regular Flex SDK > customers > > > used to brand their applications. In the second kind, I don't think = it > > > matters as much as to what default styles are. Folks will simply > override > > > the defaults in their themes. > > > > > > I was a bit surprised that MDL didn't override everything we set as > > > defaults for HTML.swc. That means to me that if someone has certain > > > styles set elsewhere, even in their browser settings, that could caus= e > > > really strange and unexpected results. But OK, that's the way it is, > and > > > so we should think of other ways to have a default look for HTML.swc, > > > although again, as I said above, the MDL library has no obligation to > > > inherit from HTML.swc. > > > > > > If we really need to support more inheritance, then maybe all visual > > > styles should be moved from HTML into some default theme. It would b= e > > > nice to have a better set of defaults that are a bit more production > > ready > > > for Basic so we can see how and why there are collisions between > themes. > > > > > > >You could as well use documentation to expose requirements and make > > people > > > >know that 2 or 3 styles are required and if they remove from CSS > things > > > >could break. We could prepare as well a MVCSS (minimum viable CSS) s= o > > > >people would not need to use the remove default compiler flag, and > have > > > >another with relative positions, borders and other no-so required > > things, > > > >but needed in basic comp set. > > > > > > > > > > > > > > Way back in early Flex, we found our customers didn't like this. The= re > > > was a version of Flex where only the type-selectors with the same nam= e > as > > > the component was applied. So CheckBox extended Button and lots of > > styles > > > important to Button needed to be copied to the CheckBox type selector= . > > > This was way faster at runtime because we didn't have to chase down t= he > > > super classes and their styles. But customers really complained becau= se > > if > > > you subclassed Button and made a MyButton, you had to know which styl= es > > to > > > copy to a MyButton type selector or the component wouldn't work. I'm > > sure > > > our documentation was not sufficient, but even then, folks thought it > was > > > a pain. > > > > > > If you want to ensure no styles are specified in code for the MDL > library > > > feel free to do so. I'm just not sure how important tat is for the > Basic > > > set. > > > > > > > > > > >> Similarly, Label isn't supposed to be interactive, so we turn off > > mouse > > > >> events. It is the equivalent of mouseEnabled in SWF. The way we > > found > > > >>to > > > >> do it is to set a style. Again, I'm not sure that should be > settable > > > >>in a > > > >> CSS theme. > > > >> > > > >> > > > >I think so. If we could set the style in CSS and we are not doing th= is > > > >because we are afraid of our user...that's a very bad policy. There'= s > > > >other > > > >methods to avoid that. For example, if in MDL mouseEnabled is not > > > >contemplated...I would left in my CSS. > > > > > > > > > > > > > > > >> The way we handle visible=3Dfalse also sets a style: display:none. > > > > > > > > > > > >that's one of the styles I historically use when doing some html, an= d > > > >always put in CSS...there's no reason not doing the same in FlexJS > > > >moreover > > > >taking into account this is a framework to craft things and nothing > > final. > > > > > > IMO, there are styles that are functional like display:none and > > > pointer-events and no-wrap and styles that are visual. For functiona= l > > > styles, I'm not sure it is the easiest API to make folks work with al= l > of > > > these CSS styles instead of through properties on the component, > > > especially properties that have a high likelihood of changing at > runtime. > > > So that's why Basic has a visible and alpha properties. Seems nicer = to > > > set those than have to set style.display =3D "none". Yes it means yo= u > > can't > > > set things invisible by changing CSS themes, but again, someone is > > welcome > > > to create a different component set that does make folks use > > style.display > > > =3D "none". > > > > > > Again, going back to the first point. There is often no right answer= , > so > > > we are working hard to make sure FlexJS can support multiple > independent > > > component sets so customers can choose the API surfaces that they lik= e > > > best. > > > > > > My 2 cents, > > > -Alex > > > > > > > > > > > > -- > > Carlos Rovira > Director General > M: +34 607 22 60 05 > http://www.codeoscopic.com > http://www.avant2.es > > Este mensaje se dirige exclusivamente a su destinatario y puede contener > informaci=C3=B3n privilegiada o confidencial. Si ha recibido este mensaje= por > error, le rogamos que nos lo comunique inmediatamente por esta misma v=C3= =ADa y > proceda a su destrucci=C3=B3n. > > De la vigente Ley Org=C3=A1nica de Protecci=C3=B3n de Datos (15/1999), le= comunicamos > que sus datos forman parte de un fichero cuyo responsable es CODEOSCOPIC > S.A. La finalidad de dicho tratamiento es facilitar la prestaci=C3=B3n de= l > servicio o informaci=C3=B3n solicitados, teniendo usted derecho de acceso= , > rectificaci=C3=B3n, cancelaci=C3=B3n y oposici=C3=B3n de sus datos dirigi= =C3=A9ndose a nuestras > oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentaci=C3= =B3n > necesaria. > --94eb2c04b9181158b2054350273f--