postcss-sort-media-queries 4.2.1 → 4.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README-UZ.md +265 -0
- package/README.md +259 -219
- package/browser.js +54 -54
- package/index.js +52 -52
- package/package.json +95 -88
- package/CHANGELOG.md +0 -276
package/README-UZ.md
ADDED
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
# PostCSS tartiblash media so'rovlari
|
|
2
|
+
|
|
3
|
+
[PostCSS]: https://github.com/postcss/postcss
|
|
4
|
+
[MIT]: https://github.com/yunusga/postcss-sort-media-queries/blob/master/LICENSE
|
|
5
|
+
[official docs]: https://github.com/postcss/postcss#usage
|
|
6
|
+
[Releases history]: https://github.com/yunusga/postcss-sort-media-queries/blob/master/CHANGELOG.md
|
|
7
|
+
|
|
8
|
+
[](https://www.npmjs.com/package/postcss-sort-media-queries) [](https://github.com/yunusga/postcss-sort-media-queries/actions/workflows/test.yml)
|
|
9
|
+
[](https://www.npmjs.com/package/postcss-sort-media-queries)
|
|
10
|
+
|
|
11
|
+
<img src="logo.svg?sanitize=true" align="right" title="PostCSS sort media queries logotype" width="100" height="100">
|
|
12
|
+
|
|
13
|
+
🌏 [**English**](README.md) ▫ **O'zbek**
|
|
14
|
+
|
|
15
|
+
[PostCSS] CSS media so'rovlarini **mobil qurilma** va **ish stoli kompyuter** metodologiyalari bilan ularni saralash va birlashtirish uchun xizmat qiladi.
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
> 5.0.0 plaginini qo'llab-quvvatlaydigan [Media funksiyasi turlari: “diapazon”](https://www.w3.org/TR/mediaqueries-4/#mq-ranges)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## Mundarija
|
|
23
|
+
|
|
24
|
+
- [Onlayn demo](#onlayn-demo)
|
|
25
|
+
- [Misollar](#misollar)
|
|
26
|
+
- [Mobil qurilmalarni tartiblash](#mobil-qurilmalarni-tartiblash)
|
|
27
|
+
- [Ish stoli kompyuter qurilmalarni tartiblash](#ish-stoli-kompyuter-qurilmalarni-tartiblash)
|
|
28
|
+
- [O'rnatish](#ornatish)
|
|
29
|
+
- [Foydalanish](#foydalanish)
|
|
30
|
+
- [Optsiyalar](#optsiyalar)
|
|
31
|
+
- [Saralash](#saralash)
|
|
32
|
+
- [Maxsus tartiblash funksiyasi](#maxsus-tartiblash-funksiyasi)
|
|
33
|
+
- [Saralash konfiguratsiyasi](#saralash-konfiguratsiyasi)
|
|
34
|
+
- [O'zgarishlar jurnali](#ozgarishlar-jurnali)
|
|
35
|
+
- [Litsenziya](#litsenziya)
|
|
36
|
+
- [Boshqa PostCSS plaginlari](#boshqa-postcss-plaginlari)
|
|
37
|
+
- [Rahmat 💪](#rahmat)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
## Onlayn demo
|
|
41
|
+
|
|
42
|
+
Bu yerda: [onlayn demo](https://postcss-sort-media-queries.github.io)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
## Misollar
|
|
46
|
+
|
|
47
|
+
### Mobil qurilmalarni tartiblash
|
|
48
|
+
|
|
49
|
+
**oldin**
|
|
50
|
+
|
|
51
|
+
```css
|
|
52
|
+
@media screen and (max-width: 640px) {
|
|
53
|
+
.head { color: #cfcfcf }
|
|
54
|
+
}
|
|
55
|
+
@media screen and (max-width: 768px) {
|
|
56
|
+
.footer { color: #cfcfcf }
|
|
57
|
+
}
|
|
58
|
+
@media screen and (max-width: 640px) {
|
|
59
|
+
.main { color: #cfcfcf }
|
|
60
|
+
}
|
|
61
|
+
@media screen and (min-width: 1280px) {
|
|
62
|
+
.mobile-first { color: #cfcfcf }
|
|
63
|
+
}
|
|
64
|
+
@media screen and (min-width: 640px) {
|
|
65
|
+
.mobile-first { color: #cfcfcf }
|
|
66
|
+
}
|
|
67
|
+
@media screen and (max-width: 640px) {
|
|
68
|
+
.footer { color: #cfcfcf }
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**keyin**
|
|
73
|
+
|
|
74
|
+
```css
|
|
75
|
+
@media screen and (min-width: 640px) {
|
|
76
|
+
.mobile-first { color: #cfcfcf }
|
|
77
|
+
}
|
|
78
|
+
@media screen and (min-width: 1280px) {
|
|
79
|
+
.mobile-first { color: #cfcfcf }
|
|
80
|
+
}
|
|
81
|
+
@media screen and (max-width: 768px) {
|
|
82
|
+
.footer { color: #cfcfcf }
|
|
83
|
+
}
|
|
84
|
+
@media screen and (max-width: 640px) {
|
|
85
|
+
/* birlashtirilgan */
|
|
86
|
+
.head { color: #cfcfcf }
|
|
87
|
+
.main { color: #cfcfcf }
|
|
88
|
+
.footer { color: #cfcfcf }
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Ish stoli kompyuter qurilmalarni tartiblash
|
|
93
|
+
|
|
94
|
+
**oldin**
|
|
95
|
+
```css
|
|
96
|
+
@media screen and (max-width: 640px) {
|
|
97
|
+
.header { color: #cdcdcd }
|
|
98
|
+
}
|
|
99
|
+
@media screen and (min-width: 760px) {
|
|
100
|
+
.desktop-first { color: #cdcdcd }
|
|
101
|
+
}
|
|
102
|
+
@media screen and (max-width: 640px) {
|
|
103
|
+
.main { color: #cdcdcd }
|
|
104
|
+
}
|
|
105
|
+
@media screen and (min-width: 1280px) {
|
|
106
|
+
.desktop-first { color: #cdcdcd }
|
|
107
|
+
}
|
|
108
|
+
@media screen and (max-width: 760px) {
|
|
109
|
+
.footer { color: #cdcdcd }
|
|
110
|
+
}
|
|
111
|
+
@media screen and (max-width: 640px) {
|
|
112
|
+
.footer { color: #cdcdcd }
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
**keyin**
|
|
117
|
+
|
|
118
|
+
```css
|
|
119
|
+
@media screen and (max-width: 760px) {
|
|
120
|
+
.footer { color: #cdcdcd }
|
|
121
|
+
}
|
|
122
|
+
@media screen and (max-width: 640px) {
|
|
123
|
+
/* combined */
|
|
124
|
+
.header { color: #cdcdcd }
|
|
125
|
+
.main { color: #cdcdcd }
|
|
126
|
+
.footer { color: #cdcdcd }
|
|
127
|
+
}
|
|
128
|
+
@media screen and (min-width: 760px) {
|
|
129
|
+
.desktop-first { color: #cdcdcd }
|
|
130
|
+
}
|
|
131
|
+
@media screen and (min-width: 1280px) {
|
|
132
|
+
.desktop-first { color: #cdcdcd }
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## O'rnatish
|
|
137
|
+
|
|
138
|
+
Birinchi navbatda, modulni o'rnating:
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
npm install postcss postcss-sort-media-queries --save-dev
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Foydalanish
|
|
145
|
+
|
|
146
|
+
Mavjud PostCSS konfiguratsiyasi uchun loyihangizni tekshiring: `postcss.config.js`
|
|
147
|
+
loyiha ildizida, `package.json` ichidagi `"postcss"` bo`limida
|
|
148
|
+
yoki to'plam konfiguratsiyasida "postcss".
|
|
149
|
+
|
|
150
|
+
Agar siz allaqachon PostCSS-dan foydalansangiz, plaginni plaginlar ro'yxatiga qo'shing:
|
|
151
|
+
|
|
152
|
+
```diff
|
|
153
|
+
module.exports = {
|
|
154
|
+
plugins: [
|
|
155
|
+
+ require('postcss-sort-media-queries')({
|
|
156
|
+
+ sort: 'mobile-first', // default value
|
|
157
|
+
+ }),
|
|
158
|
+
require('autoprefixer')
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
yoki maxsus tartiblash funksiyasi bilan
|
|
164
|
+
```diff
|
|
165
|
+
module.exports = {
|
|
166
|
+
plugins: [
|
|
167
|
+
+ require('postcss-sort-media-queries')({
|
|
168
|
+
+ sort: function(a, b) {
|
|
169
|
+
+ // custom sorting function
|
|
170
|
+
+ }
|
|
171
|
+
+ }),
|
|
172
|
+
require('autoprefixer')
|
|
173
|
+
]
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Agar siz PostCSS-dan foydalanmasangiz, uni [official docs] ga
|
|
178
|
+
muvofiq qo'shing va sozlamalarda ushbu plaginni o'rnating.
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
## Optsiyalar
|
|
182
|
+
|
|
183
|
+
> Saralash asosida ishlaydi, funktsiyasi [dutchenkoOleg/sort-css-media-queries](https://github.com/dutchenkoOleg/sort-css-media-queries)
|
|
184
|
+
|
|
185
|
+
### Saralash
|
|
186
|
+
|
|
187
|
+
Ushbu parametr **string** yoki **funktsiya** qiymatlarini qo'llab-quvvatlaydi.
|
|
188
|
+
|
|
189
|
+
- `{string}` `'mobile-first'` - (standart) mobil qurilmalarni tartiblash
|
|
190
|
+
- `{string}` `'desktop-first'` - kompyuter qurilmalarni tartiblash
|
|
191
|
+
- `{function}` o'zingizning saralash funksiyangiz
|
|
192
|
+
|
|
193
|
+
#### `'mobil-qurilmalar'`
|
|
194
|
+
|
|
195
|
+
```js
|
|
196
|
+
postcss([
|
|
197
|
+
sortMediaQueries({
|
|
198
|
+
sort: 'mobile-first' // standart
|
|
199
|
+
})
|
|
200
|
+
]).process(css);
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
#### `'kompyuter-qurilmalar'`
|
|
204
|
+
|
|
205
|
+
```js
|
|
206
|
+
postcss([
|
|
207
|
+
sortMediaQueries({
|
|
208
|
+
sort: 'desktop-first'
|
|
209
|
+
})
|
|
210
|
+
]).process(css);
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### Maxsus tartiblash funksiyasi
|
|
214
|
+
```js
|
|
215
|
+
postcss([
|
|
216
|
+
sortMediaQueries({
|
|
217
|
+
function(a, b) {
|
|
218
|
+
return a.localeCompare(b);
|
|
219
|
+
}
|
|
220
|
+
})
|
|
221
|
+
]).process(css);
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Ishbu misolda barcha media so'rovlaringiz A dan Z gacha tartib bo'yicha saralanadi
|
|
225
|
+
|
|
226
|
+
Ushbu tartiblash funksiyasi to'g'ridan-to'g'ri barcha media so'rovlaringiz qatorini Array#sort() usuliga o'tkaziladi.
|
|
227
|
+
|
|
228
|
+
### Saralash konfiguratsiyasi
|
|
229
|
+
|
|
230
|
+
Ushbu konfiguratsiya orqali siz tartiblash xatti-harakatlarini boshqarishingiz mumkin.
|
|
231
|
+
|
|
232
|
+
```js
|
|
233
|
+
postcss([
|
|
234
|
+
sortMediaQueries({
|
|
235
|
+
configuration: {
|
|
236
|
+
unitlessMqAlwaysFirst: true, // yoki false
|
|
237
|
+
}
|
|
238
|
+
})
|
|
239
|
+
]).process(css);
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
Yoki muqobil ravishda loyihangiz ildizida “sort-css-mq.config.json” faylini yarating. Yoki “package.json”ingizga “sortCssMQ: {}” xususiyatini qo‘shing.
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
## O'zgarishlar jurnali
|
|
247
|
+
|
|
248
|
+
Bu yerda: [Releases history]
|
|
249
|
+
|
|
250
|
+
## Litsenziya
|
|
251
|
+
|
|
252
|
+
[MIT]
|
|
253
|
+
|
|
254
|
+
## Boshqa PostCSS plaginlari
|
|
255
|
+
|
|
256
|
+
- [`postcss-momentum-scrolling`](https://github.com/yunusga/postcss-momentum-scrolling) - iOS tizimida toʻlib-toshgan (aylantirish, avtomatik) elementlar uchun **momentum** uslubidagi aylantirish harakatini qoʻshish uchun plagin (`-webkit-overflow-scrolling:touch`)
|
|
257
|
+
|
|
258
|
+
## Rahmat
|
|
259
|
+
|
|
260
|
+
- Andrey Sitnik [@ai](https://github.com/ai)
|
|
261
|
+
- Oleh Dutchenko [@dutchenkoOleg](https://github.com/dutchenkoOleg)
|
|
262
|
+
- Jakub Caban [@Lustmored](https://github.com/Lustmored)
|
|
263
|
+
- Dmytro Symonov [@Kassaila](https://github.com/Kassaila)
|
|
264
|
+
- Kai Falkowski [@SassNinja](https://github.com/SassNinja)
|
|
265
|
+
- Khayot Razzakov [@SassNinja](https://github.com/Khayotbek1)
|