├── images
├── regiones.png
├── componente.png
├── elementos.png
├── mutable.sketch
├── componente-anidado.png
└── componente-mutable.png
├── changelog.md
├── README.md
└── LICENSE
/images/regiones.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mutable-tools/MutableCSS/HEAD/images/regiones.png
--------------------------------------------------------------------------------
/images/componente.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mutable-tools/MutableCSS/HEAD/images/componente.png
--------------------------------------------------------------------------------
/images/elementos.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mutable-tools/MutableCSS/HEAD/images/elementos.png
--------------------------------------------------------------------------------
/images/mutable.sketch:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mutable-tools/MutableCSS/HEAD/images/mutable.sketch
--------------------------------------------------------------------------------
/images/componente-anidado.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mutable-tools/MutableCSS/HEAD/images/componente-anidado.png
--------------------------------------------------------------------------------
/images/componente-mutable.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mutable-tools/MutableCSS/HEAD/images/componente-mutable.png
--------------------------------------------------------------------------------
/changelog.md:
--------------------------------------------------------------------------------
1 | ##Changelog
2 |
3 | - 20150220: fork de [RSCSS](https://github.com/rstacruz/rscss)
4 | - 20150313: primer borrador en español adaptado para proyectos frontend en I2B
5 | - 20150316
6 | - correccion de errores menores
7 | - normalizando nombre de archivos
8 | - agregado sección TO-DO
9 | - 20150318
10 | - fonts: agregado `px` como unidad preferida para `font-size` y `line-height` sin unidad.
11 | - 20150327: nuevo repo propio, ya adquiere personalidad propia alejándose de *RSCSS*.
12 | - 20150408:
13 | - agregado *regiones*, normalizado *componentes* y *elementos*. a
14 | - agregado *consideraciones generales* para *componentes* y *elementos*.
15 | - mejoradas imágenes de apoyo.
16 | - 20150414: limpiando contenido y realizado primer release: *v0.5*
17 | - 20150416: especificado nomenclatura de *mutables*
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Mutable CSS
2 | =====
3 |
4 | **Estándar para estructura CSS a través de Regiones, Componentes, Elementos y Mutables.**
5 |
6 |
7 | ### TL;DR
8 |
9 | - Define **regiones**, zonas reutilizables que compondrán tu layout: `section, nav, aside, article, main, header, footer` y decláralas con ID's semánticos en el HTML.
10 | - Crea **componentes** modulares y nómbralos con 2 palabras separadas por un guión (`-`): `.screenshot-image`.
11 | - Components contienen **elementos**, nómbralos con 1 palabra: `.title`.
12 | - Componentes y elementos tienen **mutables**, variaciones que se declaran un guión (`-`) como prefijo y de 2 tipos: variaciones de *diseño*: `-large`, `-small` de *estado*: `-disabled`, `-active`.
13 | - Componentes y elementos pueden ser heredados y no deben tener propiedades de posicionamiento y tamaño; defíneselos en su contexto y apóyate de las regiones.
14 |
15 |
16 | Regiones
17 | ---------------
18 |
19 | Todo layout se compone de regiones globales, las cuales se definen según el [seccionamiento de HTML5](http://blog.teamtreehouse.com/use-html5-sectioning-elements). Estas regiones se identificarán a través del atributo `id=""` conformadas de una sola palabra, lo que permitirá tener mejor semántica y mejor acceso desde marcas de analítica. Evita apoyarte de estos `ID's` para definir estilos, puede ser dañino al ser mal utilizado (en la duda, mejor evitar).
20 |
21 | 
22 |
23 | Ejemplos de regiones comúnes se listan a continuación:
24 |
25 | - `#header`
26 | - `#content`
27 | - `#sidebar`
28 | - `#footer`
29 |
30 |
31 | Componentes
32 | ---------------
33 |
34 | Cada pieza de la interfaz corresponde a un *componente* individual. Componentes serán nombrados con **por lo menos 2 palabras** en inglés y separadas con un guión (`-`), por ejemplo:
35 |
36 | * Un menú (`.menu-header`)
37 | * Un formulario de búsqueda (`.form-search`)
38 | * Una caja de perfil de usuario (`.box-user-profile`)
39 |
40 | 
41 |
42 | Nótese que el componente comienza con el tipo de componente (**menu, form, box**) y la siguiente palabra es el contexto ó ubicación única en una región ó función (**header, search, user profile**). Esto es para poder identificar rápida y fácilmente otros tipos de componentes similares, porque como sabemos existirán varios `.menu-` y muchos `.box-` entre otros.
43 |
44 | #### Componentes anidados
45 |
46 | 
47 |
48 | Se permite anidar componentes si se requiere:
49 |
50 | ```html
51 |
52 |
53 | ...
54 |
55 |
...
56 |
...
57 |
58 | ```
59 |
60 | Elementos
61 | ---------------
62 |
63 | Cada componente contiene uno o más elementos. Los nombres de clases para elementos **tienen sólo una palabra**:
64 |
65 | ```scss
66 | .form-search { // componente
67 |
68 | .field { /* ... */ } // elemento
69 | .button { /* ... */ } // elemento
70 | }
71 | ```
72 |
73 | 
74 |
75 | **Palabras múltiples:** Cuando necesites utilizar nombres compuestos para tu clase, déjalas juntas sin guión:
76 |
77 | ```scss
78 | .box-user-profile {
79 |
80 | .firstname { /* ... */ }
81 | .lastname { /* ... */ }
82 | .email { /* ... */ }
83 | }
84 | ```
85 |
86 | **Evita selectores de etiquetas:** prefiere utilizar clases CSS en vez de etiquetas HTML como selectores, para mejor rendimiento y semántica.
87 |
88 | ```scss
89 | .box-user-profile {
90 |
91 | h3 { /* nop */ }
92 | .firstname { /* bien */ }
93 | }
94 | ```
95 |
96 | Si ves la necesidad de hacerlo (por ejemplo, para dar estilos todos los `
` dentro de un `
` prefiere el selector de hijo directo `>`:
97 |
98 | ```scss
99 | .box-content {
100 |
101 | > p { /* bueno ya */ }
102 | }
103 | ```
104 |
105 | Mutables
106 | ---------------
107 |
108 | 
109 |
110 | Componentes y Elementos son mutables ya que pueden tener variaciones de estilos respecto a la definición general. Para esto se crean clases que aportan cambios a los estilos originales y se prefijan con un guión (`-`):
111 |
112 | ```scss
113 | .box-user-profile {
114 |
115 | &.-wide { }
116 | &.-small { }
117 | }
118 |
119 | .button{
120 |
121 | &.-disabled { }
122 | }
123 | ```
124 |
125 | Los tipos de variaciones se clasifican en 2 grupos: diseño y estado.
126 |
127 | #### Diseño
128 | Son los que cambian el estilo del elemento ó componente y los más comunes se listan a continuación:
129 |
130 | - wide: `.-wide`
131 | - narrow: `.-narrow`
132 | - big: `.-big`
133 | - small: `.-small`
134 | - tall: `.-tall`
135 | - short: `.-short`
136 | - large: `.-large`
137 | - lower: `.-lower`
138 | - upper: `.-upper`
139 | - centered: `.-centered`
140 | - bold: `.-bold`
141 | - light: `.-light`
142 |
143 | #### Estado
144 | Son los que cambian el estado de un elemento ó componente y los comunes son:
145 |
146 | - `.-disabled`
147 | - `.-enabled`
148 | - `.-visible`
149 | - `.-hidden`
150 |
151 | **Uso:**
152 |
153 | ```html
154 |
155 | ```
156 |
157 | Se permiten tener varios mutables por componente/elemento:
158 |
159 | ```html
160 |
161 | ```
162 |
163 | Consideraciones Generales
164 | ---------------
165 |
166 | **Tamaños fijos**: evita darle ancho/alto fijo a componentes; excepciones son avatares, cajas de votación y otras.
167 |
168 | **Evita propiedades de posicionamiento**: componentes y elementos deben ser creados de una manera en que sean reutilizables en diferentes contextos y debe respetar la grilla que la contiene.
169 |
170 | Evita:
171 |
172 | * Posicionamiento (`position`, `top`, `left`, `right`, `bottom`)
173 | * Flotado (`float`, `clear`)
174 | * Margen (`margin`)
175 | * Tamaño (`width`, `height`)
176 |
177 | Y utiliza las clases que la grilla te entrega.
178 |
179 | **Define tamaño y posicionamiento en el contexto no en el componente:** Si necesitas definir estas propiedades, hazlo en el contexto del componente (ó en la región que lo contiene) no en la definición del componente:
180 |
181 | ```css
182 | // CONTEXTO
183 | . list-article {
184 |
185 | .box-article {
186 | width: 33.3%;
187 | float: left;
188 | }
189 | }
190 | // REGION
191 | #header {
192 |
193 | .box-article {
194 | width: 33.3%;
195 | float: left;
196 | }
197 | }
198 |
199 | // COMPONENTE
200 | .box-article {
201 | /* ... */
202 |
203 | // ELEMENTOS
204 | > .image { /* ... */ }
205 | > .title { /* ... */ }
206 | > .meta { /* ... */ }
207 | }
208 | ```
209 |
210 |
211 | #### Licencia:
212 |
213 | > **Mutable CSS** es distribuido bajo la licencia [Creative Commons Attribution-ShareAlike 4.0 International](http://creativecommons.org/licenses/by-sa/4.0/).
214 |
215 | > Copyright (c) 2015 por [Jorge Epuñan](https://github.com/juanbrujo)
216 |
217 | #### TO-DO:
218 | - Agregar *Regiones*
219 | - Normalizar nomenclatura de regiones, componentes y elementos (y sus mutables)
220 | - Mejorar imágenes de ejemplos
221 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Creative Commons Attribution-ShareAlike 4.0 International Public License
2 |
3 | By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-ShareAlike 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions.
4 |
5 | Section 1 – Definitions.
6 |
7 | Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image.
8 | Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License.
9 | BY-SA Compatible License means a license listed at creativecommons.org/compatiblelicenses, approved by Creative Commons as essentially the equivalent of this Public License.
10 | Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights.
11 | Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements.
12 | Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material.
13 | License Elements means the license attributes listed in the name of a Creative Commons Public License. The License Elements of this Public License are Attribution and ShareAlike.
14 | Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License.
15 | Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license.
16 | Licensor means the individual(s) or entity(ies) granting rights under this Public License.
17 | Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them.
18 | Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world.
19 | You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning.
20 | Section 2 – Scope.
21 |
22 | License grant.
23 | Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to:
24 | reproduce and Share the Licensed Material, in whole or in part; and
25 | produce, reproduce, and Share Adapted Material.
26 | Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions.
27 | Term. The term of this Public License is specified in Section 6(a).
28 | Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material.
29 | Downstream recipients.
30 | Offer from the Licensor – Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License.
31 | Additional offer from the Licensor – Adapted Material. Every recipient of Adapted Material from You automatically receives an offer from the Licensor to exercise the Licensed Rights in the Adapted Material under the conditions of the Adapter’s License You apply.
32 | No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material.
33 | No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i).
34 | Other rights.
35 |
36 | Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise.
37 | Patent and trademark rights are not licensed under this Public License.
38 | To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties.
39 | Section 3 – License Conditions.
40 |
41 | Your exercise of the Licensed Rights is expressly made subject to the following conditions.
42 |
43 | Attribution.
44 |
45 | If You Share the Licensed Material (including in modified form), You must:
46 |
47 | retain the following if it is supplied by the Licensor with the Licensed Material:
48 | identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated);
49 | a copyright notice;
50 | a notice that refers to this Public License;
51 | a notice that refers to the disclaimer of warranties;
52 | a URI or hyperlink to the Licensed Material to the extent reasonably practicable;
53 | indicate if You modified the Licensed Material and retain an indication of any previous modifications; and
54 | indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License.
55 | You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information.
56 | If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable.
57 | ShareAlike.
58 | In addition to the conditions in Section 3(a), if You Share Adapted Material You produce, the following conditions also apply.
59 |
60 | The Adapter’s License You apply must be a Creative Commons license with the same License Elements, this version or later, or a BY-SA Compatible License.
61 | You must include the text of, or the URI or hyperlink to, the Adapter's License You apply. You may satisfy this condition in any reasonable manner based on the medium, means, and context in which You Share Adapted Material.
62 | You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, Adapted Material that restrict exercise of the rights granted under the Adapter's License You apply.
63 | Section 4 – Sui Generis Database Rights.
64 |
65 | Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material:
66 |
67 | for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database;
68 | if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material, including for purposes of Section 3(b); and
69 | You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database.
70 | For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights.
71 | Section 5 – Disclaimer of Warranties and Limitation of Liability.
72 |
73 | Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.
74 | To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.
75 | The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.
76 | Section 6 – Term and Termination.
77 |
78 | This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically.
79 | Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates:
80 |
81 | automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or
82 | upon express reinstatement by the Licensor.
83 | For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License.
84 | For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License.
85 | Sections 1, 5, 6, 7, and 8 survive termination of this Public License.
86 | Section 7 – Other Terms and Conditions.
87 |
88 | The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.
89 | Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.
90 | Section 8 – Interpretation.
91 |
92 | For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License.
93 | To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions.
94 | No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor.
95 | Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority.
96 | Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” The text of the Creative Commons public licenses is dedicated to the public domain under the CC0 Public Domain Dedication. Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at creativecommons.org/policies, Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses.
97 |
98 | Creative Commons may be contacted at creativecommons.org.
--------------------------------------------------------------------------------