forked from workshopper/learn-sass
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add German translation for problem.md
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# NESTED PROPERTIES | ||
|
||
In CSS gibt es einige Eigenschaften in sogenannten “namespaces;” zum Beispiel sind `font-family`, `font-size` und `font-weight` alle im `font`-Namespace. Wenn man in CSS ein Bündel von Eigenschaften im selben Namespace definieren möchte, muss man diesen jedes Mal ausschreiben. SASS bietet eine Abkürzung für diese Fälle: Man schreibt den Namespace nur einmal, dann wird dieser für jede der Untereigenschaften herangezogen (Stichwort Schachtelung). Zum Beispiel: | ||
|
||
```scss | ||
.funky { | ||
font: { | ||
family: fantasy; | ||
size: 30em; | ||
weight: bold; | ||
} | ||
} | ||
``` | ||
|
||
wird kompiliert zu: | ||
|
||
```css | ||
.funky { | ||
font-family: fantasy; | ||
font-size: 30em; | ||
font-weight: bold; } | ||
``` | ||
|
||
Der Eigenschaftsnamespace selbst kann auch einen Wert bekommen. Zum Beispiel: | ||
|
||
```scss | ||
.funky { | ||
font: 20px/24px fantasy { | ||
weight: bold; | ||
} | ||
} | ||
``` | ||
|
||
wird kompiliert zu: | ||
|
||
```css | ||
.funky { | ||
font: 20px/24px fantasy; | ||
font-weight: bold; | ||
} | ||
``` | ||
|
||
# ÜBUNG | ||
|
||
Definiere einen Selektor `.sassy` und verwende die geschachtelten Eigenschaften, um `border-width` auf '10px' zu setzen, `border-color` auf 'red' und `border-radius` auf '5px'. |