Konventionen: Unterschied zwischen den Versionen
Keine Bearbeitungszusammenfassung |
|||
| (76 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt) | |||
| Zeile 1: | Zeile 1: | ||
= | =LessCSS= | ||
Externe Ressourcen: | |||
*[http://www.lesscss.de/ LessCSS.de] | |||
*[http://lesscss.org/ LessCSS.org] | |||
==Allgemein== | ==Allgemein== | ||
===Comments (Kommentare)=== | ===Comments (Kommentare)=== | ||
====Bereich==== | ====Bereich==== | ||
/*** | /*** | ||
comment | comment | ||
| Zeile 10: | Zeile 15: | ||
====Unter Bereich==== | ====Unter Bereich==== | ||
wird verwendet zB. Bei zwischenbereiche unter den Paragraphen. | |||
/* Image im content **********************************************/ | /* Image im content **********************************************/ | ||
====Linien Comment==== | ====Linien Comment==== | ||
<copylink>width: 960px;</copylink> '''//Seitenbreite''' | |||
==Einheiten== | |||
===font-size=== | |||
{| class="wikitable" | |||
| em || relativ zur Schrifgrösse im Elternelement | |||
|- | |||
| rem || relativ zur Schriftgrösse im root-Element (html) | |||
|} | |||
===line-height:=== | |||
ohne Einheit! | |||
===font-weight=== | |||
{| class="wikitable" | |||
| 'Zahl' || 100, 200, 300, ..., 900, je nach dem, was von Google Fonts o.ä. importiert wurde | |||
|- | |||
| normal || entspricht der Dicke 400 | |||
|- | |||
| bold || enspricht der Dicke 700 | |||
|} | |||
siehe auch: https://developer.mozilla.org/de/docs/Web/CSS/font-weight | |||
===margin, padding=== | |||
{| class="wikitable" | |||
| px | |||
|- | |||
| em || relativ zur Schriftgrösse des Elements | |||
|- | |||
| % || definiert ein Margin in % der ''Breite'' des Elements (auch bei margin-top und margin-bottom!) | |||
|} | |||
===width, height=== | |||
{| class="wikitable" | |||
| px | |||
|- | |||
| em || relativ zur Schriftgrösse des Elements | |||
|- | |||
| % || definiert eine Breite/Höhe in % des Elternelements | |||
|- | |||
| vw, vh || relativ zu 1% der Viewport-Breite/-Höhe ( ! Browsersupport) | |||
|} | |||
===max-width, max-height=== | |||
{| class="wikitable" | |||
| px | |||
|- | |||
| em || relativ zur Schriftgrösse des Elements | |||
|- | |||
| % || definiert eine maximale Breite/Höhe in % des Elternelements | |||
|} | |||
siehe: http://www.w3schools.com/css/css_dimension.asp | |||
===Position top, bottom, left, right=== | |||
{| class="wikitable" | |||
| px | |||
|- | |||
| em || relativ zur Schriftgrösse des Elements | |||
|- | |||
| % || definiert eine Position in % des Elternelements | |||
|} | |||
==Farben== | |||
===Erlaubte Farbgebung=== | |||
<syntaxhighlight lang="css"> | |||
Hex -> #000000 /*Grundfarbe*/ | |||
Hex -> #000 /*Grundfarbe*/ | |||
mix(#000000, #fffff, 15%); /*Farben mischen mix(GRUNDFARBE, MISCHEN MIT, 15%); für Farbabstufungen mit Weiss mischen*/ | |||
</syntaxhighlight> | |||
===Transparenz=== | |||
<syntaxhighlight lang="css"> | |||
rgba (00,00,00,0.7) | |||
fadeout(@color, 30%); | |||
</syntaxhighlight> | |||
==Mixins== | ==Mixins== | ||
| Zeile 39: | Zeile 128: | ||
===Micro Clearfix Hack=== | ===Micro Clearfix Hack=== | ||
[http://nicolasgallagher.com/micro-clearfix-hack/ | [http://nicolasgallagher.com/micro-clearfix-hack/ nach Nicolas Gallagher] | ||
<syntaxhighlight lang="css"> | <syntaxhighlight lang="css"> | ||
.clearfix { | .clearfix { | ||
| Zeile 62: | Zeile 151: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
===[[Box Shadow Mixin]]=== | |||
Mixin für Material Design Box Shadow von [https://medium.com/@Florian/freebie-google-material-design-shadow-helper-2a0501295a2d#.3oewis332| Florian Kutschera] | |||
.boxShadow(@level: 1) | |||
Level 1-5: verschieden grosse Schatten | |||
Anwendung: Klasse im Boxelement hinzufügen, das einen Schatten erhalten soll. | |||
===[[Button Mixin]]=== | |||
Mixin für einheitliche Buttons | |||
.button(@buttonWidth: 100%, @borderRadius: 5px) | |||
Variablen: sind selbstredend... | |||
Anwendung: Klasse im a-Element des Button einfügen. | |||
==Variables== | ==Variables== | ||
===Benennung der Variablen=== | ===Benennung der Variablen=== | ||
@ | {| class="wikitable" style="float:left" | ||
Beispiel: | !Titel||Beispiel||Beschreibung | ||
@sf_font_color: | |- | ||
|Variable||@||dass es eine Variable ist. | |||
|- | |||
|Modul||sf||gugusDas Modul oder Bereich wo dass das eingesetzt wird. | |||
|- | |||
|Selektor||font||Welche CSS eigenschaften | |||
|- | |||
|Style||color||Was definiert wird. | |||
|- | |||
|Trenner||_||Wird durch einen Underline getrennt! | |||
|} | |||
<div style="clear:both"></div> | |||
====Beispiel:==== | |||
@modul_selector_stlye: | |||
| | | | |||
sf font color | |||
@sf_font_color: @color1; | |||
== | =Aufbau einer CSS/LESS-Datei= | ||
Bemerkung: dies sind Konventionen, die zukünftig eingeführt werden. | |||
===1. Grund-Deklarationen=== | |||
====im html Selektor==== | |||
Typographische Grundlagen: | |||
*font-size | |||
*line-hight | |||
*color | |||
*font-family | |||
*font-weight | |||
= | ====im body selector==== | ||
= | *background-color | ||
--fonts | ===2. Layout Deklarationen=== | ||
z.B. die IDs | |||
*page-wrapper | |||
*header | |||
*navigation | |||
*region-slider | |||
*breadcrumb | |||
*main-wrapper | |||
*footer | |||
Später ev. auch HTML5 Selektoren wie header,nav, main, footer | |||
===3. Basis Deklarationen=== | |||
*h1-h6 | |||
*p | |||
*a | |||
*ul, ol, li | |||
*... | |||
Später ev. auch HTML5 Selektoren wie article, section, aside, figure und figcaption, ... | |||
===4. Inhaltsblöcke Deklarationen=== | |||
*Listen | |||
*Formulare | |||
*Tabellen | |||
*... | |||
===5. Individuelle Deklarationen=== | |||
*... | |||
=page.tpl.php Drupal 7= | |||
[[PHP Header]] | |||
=node.tpl.php Drupal 7= | |||
=Datei Struktur Drupal 7= | |||
--'''fonts''' | |||
|--fonts //awesome font | |--fonts //awesome font | ||
--img | --'''img''' | ||
|--icon //Shortcut icon für ios und Browser etc | |--icon //Shortcut icon für ios und Browser etc | ||
--js | --'''js''' | ||
|--scripts.php // muss ein php sein, da kommen individuelle Javascripts hinein für das Design | |--[[scripts.php]] // muss ein php sein, da kommen individuelle Javascripts hinein für das Design | ||
--less | --'''less''' | ||
|--variables.less //Alle Variablen Definiert. | |--[[variables.less]] //Alle Variablen Definiert. | ||
|--[[editor.less]] //wird im Editor geladen | |--[[editor.less]] //wird im Editor geladen | ||
|--editor.less //Wird beim Editor geladen | |--editor.less //Wird beim Editor geladen | ||
--templates | --'''templates''' | ||
--theme.info | |--[[paragraphs-item]]--gallery.tpl.php | ||
--[[theme.info]] | |||
[[Datei:7theme anatomy-fix 1.png|mini]] | |||
Aktuelle Version vom 15. April 2020, 11:54 Uhr
LessCSS
Externe Ressourcen:
Allgemein
Comments (Kommentare)
Bereich
/***
comment
****************************************************************************/
Unter Bereich
wird verwendet zB. Bei zwischenbereiche unter den Paragraphen.
/* Image im content **********************************************/
Linien Comment
<copylink>width: 960px;</copylink> //Seitenbreite
Einheiten
font-size
| em | relativ zur Schrifgrösse im Elternelement |
| rem | relativ zur Schriftgrösse im root-Element (html) |
line-height:
ohne Einheit!
font-weight
| 'Zahl' | 100, 200, 300, ..., 900, je nach dem, was von Google Fonts o.ä. importiert wurde |
| normal | entspricht der Dicke 400 |
| bold | enspricht der Dicke 700 |
siehe auch: https://developer.mozilla.org/de/docs/Web/CSS/font-weight
margin, padding
| px | |
| em | relativ zur Schriftgrösse des Elements |
| % | definiert ein Margin in % der Breite des Elements (auch bei margin-top und margin-bottom!) |
width, height
| px | |
| em | relativ zur Schriftgrösse des Elements |
| % | definiert eine Breite/Höhe in % des Elternelements |
| vw, vh | relativ zu 1% der Viewport-Breite/-Höhe ( ! Browsersupport) |
max-width, max-height
| px | |
| em | relativ zur Schriftgrösse des Elements |
| % | definiert eine maximale Breite/Höhe in % des Elternelements |
siehe: http://www.w3schools.com/css/css_dimension.asp
Position top, bottom, left, right
| px | |
| em | relativ zur Schriftgrösse des Elements |
| % | definiert eine Position in % des Elternelements |
Farben
Erlaubte Farbgebung
Hex -> #000000 /*Grundfarbe*/
Hex -> #000 /*Grundfarbe*/
mix(#000000, #fffff, 15%); /*Farben mischen mix(GRUNDFARBE, MISCHEN MIT, 15%); für Farbabstufungen mit Weiss mischen*/
Transparenz
rgba (00,00,00,0.7)
fadeout(@color, 30%);
Mixins
Text markieren unterbinden
.notselecion {
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Chrome/Safari/Opera */
-khtml-user-select: none; /* Konqueror */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently */
}
Transparenz unterbinden
.noOpacity {
opacity: 1;
}
Micro Clearfix Hack
.clearfix {
&:before, &:after {
content: "";
display: table;
}
&:after {
clear: both;
}
}
Padding Abstand zwischen den Paragraphen (Aussen) in PIXEL!
.padding-abstand {
padding-left: 24px;
padding-right: 24px;
box-sizing: border-box;
}
Mixin für Material Design Box Shadow von Florian Kutschera
.boxShadow(@level: 1)
Level 1-5: verschieden grosse Schatten
Anwendung: Klasse im Boxelement hinzufügen, das einen Schatten erhalten soll.
Mixin für einheitliche Buttons
.button(@buttonWidth: 100%, @borderRadius: 5px)
Variablen: sind selbstredend...
Anwendung: Klasse im a-Element des Button einfügen.
Variables
Benennung der Variablen
| Titel | Beispiel | Beschreibung |
|---|---|---|
| Variable | @ | dass es eine Variable ist. |
| Modul | sf | gugusDas Modul oder Bereich wo dass das eingesetzt wird. |
| Selektor | font | Welche CSS eigenschaften |
| Style | color | Was definiert wird. |
| Trenner | _ | Wird durch einen Underline getrennt! |
Beispiel:
@modul_selector_stlye: | | | sf font color @sf_font_color: @color1;
Aufbau einer CSS/LESS-Datei
Bemerkung: dies sind Konventionen, die zukünftig eingeführt werden.
1. Grund-Deklarationen
im html Selektor
Typographische Grundlagen:
- font-size
- line-hight
- color
- font-family
- font-weight
im body selector
- background-color
2. Layout Deklarationen
z.B. die IDs
- page-wrapper
- header
- navigation
- region-slider
- breadcrumb
- main-wrapper
- footer
Später ev. auch HTML5 Selektoren wie header,nav, main, footer
3. Basis Deklarationen
- h1-h6
- p
- a
- ul, ol, li
- ...
Später ev. auch HTML5 Selektoren wie article, section, aside, figure und figcaption, ...
4. Inhaltsblöcke Deklarationen
- Listen
- Formulare
- Tabellen
- ...
5. Individuelle Deklarationen
- ...
page.tpl.php Drupal 7
node.tpl.php Drupal 7
Datei Struktur Drupal 7
--fonts |--fonts //awesome font --img |--icon //Shortcut icon für ios und Browser etc --js |--scripts.php // muss ein php sein, da kommen individuelle Javascripts hinein für das Design --less |--variables.less //Alle Variablen Definiert. |--editor.less //wird im Editor geladen |--editor.less //Wird beim Editor geladen --templates |--paragraphs-item--gallery.tpl.php --theme.info